Page 1 of 1
How to run PHP within Firefox
Posted: Sun Jan 02, 2011 8:32 am
by woodplaner
Good morning. I am new to Linux, Apache, PHP, and MySql. The software seems to be installed and running .
-Localhost functions from the URL line of Firefox
-PHP scripts run in Terminal
-PHP scripts do not run from the URL line of Firefox, the msg "the requested URL was not found" is displayed
Please provide suggestions of what needs changing to run PHP within Firefox. Thanks.
Re: How to run PHP within Firefox
Posted: Sun Jan 02, 2011 8:39 am
by Darhazer
woodplaner wrote:Good morning. I am new to Linux, Apache, PHP, and MySql. The software seems to be installed and running .
-Localhost functions from the URL line of Firefox
-PHP scripts run in Terminal
-PHP scripts do not run from the URL line of Firefox, the msg "the requested URL was not found" is displayed
Please provide suggestions of what needs changing to run PHP within Firefox. Thanks.
that the requested url looks like?
Re: How to run PHP within Firefox
Posted: Sun Jan 02, 2011 9:07 am
by woodplaner
Thanks for the response. The URL is:
http://localhost/phpinfo.php
phpinfo.php is a simple script that runs within Terminal at the command line.
Re: How to run PHP within Firefox
Posted: Sun Jan 02, 2011 9:17 am
by Darhazer
Where it is located? It should be in the web server's document root
Re: How to run PHP within Firefox
Posted: Sun Jan 02, 2011 9:43 am
by woodplaner
I am running Apache as a local server. How do I identify the localhost document root? I hope the fix is as simple as identifying the correct directory/subdirectory to place the scripts.
Re: How to run PHP within Firefox
Posted: Sun Jan 02, 2011 10:02 am
by Darhazer
woodplaner wrote:I am running Apache as a local server. How do I identify the localhost document root? I hope the fix is as simple as identifying the correct directory/subdirectory to place the scripts.
Look in your httpd.conf (it's most likely in /etc/apache2 or /etc/apache or /etc/httpd)
Usually the default folder is /var/www/html but can be anywhere
Re: How to run PHP within Firefox
Posted: Sun Jan 02, 2011 10:05 am
by woodplaner
Thanks. I will track it down later. For now, its off to work I go.
Re: How to run PHP within Firefox
Posted: Sun Jan 02, 2011 5:35 pm
by woodplaner
/etc/apache2/httpd.conf is a read-only, empty file/
there is no /var/www/html/ , unless it is a hidden directory
There is a /var/www/index.html, and this is the html file that runs when i execute
http://localhost/. I can open the index.html file, but I lack permission to save a .php file to /var/www/ .
Re: How to run PHP within Firefox
Posted: Mon Jan 03, 2011 1:54 am
by Darhazer
Are you using ubuntu?
You can run
sudo chmod 777 /var/www/
to grant yourself permissions. Do not run it if it's used for production server however, only if it is your local PC and there are no other users

Re: How to run PHP within Firefox
Posted: Mon Jan 03, 2011 7:31 am
by woodplaner

Thank you. Your solution worked, and I never would have worked it out! I viewed info chmod, and I did not detect options that specified 7. What change(s) did chmod make?
I am running Ubuntu 10.10.
I was able to run a script from the URL line which called phpinfo(), and that is what I have been attempting to do?
Much of what I have read about installing and running Linux and associated software is that it is easy and can be accomplished in 5 min,! However, all the material I have read does not begin at step one. There is an underlying unstated assumption of some level of familiarity. What resources do you suggest I read?
Thanks again.
Re: How to run PHP within Firefox
Posted: Mon Jan 03, 2011 8:13 am
by Darhazer
7 means read(4) + write(2) + execute(1)
777 means owner: 7; group: 7; others: 7
You need to get familiar with linux, but unfortunately I cannot recommend any tutorials. I've been using Linux for more then 3 years at work and I've learnt by need - with googling and asking.
Re: How to run PHP within Firefox
Posted: Mon Jan 03, 2011 11:41 am
by woodplaner
Ok. I will view info chmod again. Thank you.