desreguard Posted September 11, 2011 Share Posted September 11, 2011 Hey all, this is my first post ever and am not really sure if this is the right place for it or not, sorry in advance if it isn't. I'm new to PHP and trying to learn. I'm running Ubuntu 10.04 LTS and Firefox 3.6.22. I have libapache2-mod-php5 installed and running, but for some reason everytime I try to open a local .php file in firefox the download manager pops up and ask me what I want to do with the file. Has anyone else encountered this before? Is it something simple that I overlooked? Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/ Share on other sites More sharing options...
gizmola Posted September 11, 2011 Share Posted September 11, 2011 What do you mean by open? Are you accessing them through http://localhost/? Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267872 Share on other sites More sharing options...
desreguard Posted September 11, 2011 Author Share Posted September 11, 2011 I mean I have a file called test.php and I right click on it and tell it to open it firefox, then the download manager pops up. Am I doing it wrong? Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267874 Share on other sites More sharing options...
Pikachu2000 Posted September 11, 2011 Share Posted September 11, 2011 Yes. http://localhost/filename_here.php in your browser's address bar. The php file has to be served by the webserver to be parsed by the php interpreter to generate the output that will be rendered by the browser. Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267875 Share on other sites More sharing options...
desreguard Posted September 11, 2011 Author Share Posted September 11, 2011 tried that but get a 404 error saying it can't find it. The file is in my Home folder, does it have to be in the /var/www directory for it to be found? Plus I have a html file that has a link to the test.php file, but when I try to navigate there I get the dl manager. But it can find the other html pages that are linked to it. Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267879 Share on other sites More sharing options...
Pikachu2000 Posted September 11, 2011 Share Posted September 11, 2011 Yes, it needs to be in the directory the webserver is configured to use as the document root. Usually /var/www/ or /var/www/public_html/ or something along those lines. Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267880 Share on other sites More sharing options...
desreguard Posted September 11, 2011 Author Share Posted September 11, 2011 Is that only for .php files? Cuz it was able to find all my .html files no problem. Is that the only way for a .php file to be parsed? sry for all the question still a newb. Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267881 Share on other sites More sharing options...
Pikachu2000 Posted September 11, 2011 Share Posted September 11, 2011 No, it's for all files that are web-type files. php files in particular need to be parsed by the interpreter so the code is executed and sent to the browser as html markup. For the purposes of web development, you should consider that folder to be the root directory. Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267882 Share on other sites More sharing options...
desreguard Posted September 11, 2011 Author Share Posted September 11, 2011 Sweet it works now thx for all the help. Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267884 Share on other sites More sharing options...
Pikachu2000 Posted September 11, 2011 Share Posted September 11, 2011 Sure thing. If you have further questions, feel free to ask . . . Quote Link to comment https://forums.phpfreaks.com/topic/246877-cant-open-local-php-files/#findComment-1267885 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.