How to run PHP within Firefox

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
woodplaner
Forum Newbie
Posts: 13
Joined: Sun Jan 02, 2011 8:12 am

How to run PHP within Firefox

Post 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.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: How to run PHP within Firefox

Post 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?
woodplaner
Forum Newbie
Posts: 13
Joined: Sun Jan 02, 2011 8:12 am

Re: How to run PHP within Firefox

Post 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.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: How to run PHP within Firefox

Post by Darhazer »

Where it is located? It should be in the web server's document root
woodplaner
Forum Newbie
Posts: 13
Joined: Sun Jan 02, 2011 8:12 am

Re: How to run PHP within Firefox

Post 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.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: How to run PHP within Firefox

Post 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
woodplaner
Forum Newbie
Posts: 13
Joined: Sun Jan 02, 2011 8:12 am

Re: How to run PHP within Firefox

Post by woodplaner »

Thanks. I will track it down later. For now, its off to work I go.
woodplaner
Forum Newbie
Posts: 13
Joined: Sun Jan 02, 2011 8:12 am

Re: How to run PHP within Firefox

Post 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/ .
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: How to run PHP within Firefox

Post 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 :)
woodplaner
Forum Newbie
Posts: 13
Joined: Sun Jan 02, 2011 8:12 am

Re: How to run PHP within Firefox

Post by woodplaner »

:D 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.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: How to run PHP within Firefox

Post 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.
woodplaner
Forum Newbie
Posts: 13
Joined: Sun Jan 02, 2011 8:12 am

Re: How to run PHP within Firefox

Post by woodplaner »

Ok. I will view info chmod again. Thank you.
Post Reply