PHP Coding Academy Project 2

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

PHP Coding Academy Project 2

Postby Crispy » Wed Jul 28, 2010 4:44 pm

Hi,

I am working my way through Project2 and I can't seem to get it to display the php file in Firefox. All I get is it asking where to save the .php file.

If I run http://localhost/, i get a message saying "It Works!" but that there are no files eventhough I have copied project2.php into /var/www

Do I need to tell Apache to accept php? I have installed all the packages given in the introduction so do not understand whats gone wrong?

Thanks,
Chris
Crispy
 
Posts: 57
Joined: Mon May 31, 2010 6:35 pm

Postby Ram » Wed Jul 28, 2010 5:35 pm

Try:
Code: Select all
http://localhost/project2.php



as http://localhost/ will only load the default index file, hence the reason you see it works.

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1675
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby Crispy » Thu Jul 29, 2010 12:00 pm

I tried that but all I got was Firefox asking where to save the file. I managed to find the solution though on here

https://help.ubuntu.com/community/Apach ... Apache%202

All I had to do was restart the service using

sudo /etc/init.d/apache2 restart

and it now works.
Crispy
 
Posts: 57
Joined: Mon May 31, 2010 6:35 pm

Postby Hudzilla » Thu Jul 29, 2010 7:26 pm

Hey!

Yes, restarting Apache is the correct solution. I think in the mini-book I just tell people to restart their whole computer, because it saves having to explain the various different ways of restarting services on Linux :)


Paul
User avatar
Hudzilla
Site admin
 
Posts: 265
Joined: Mon Apr 04, 2005 11:52 am
Location: LXF Towers


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests