how to run php on localhost?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

how to run php on localhost?

Postby renkai on Tue Jun 26, 2007 9:24 pm

I'm missing something. I have apache2 installed and I have php5 installed (both using the Install Software manager). However when I try to browse to a php file on localhost (for example http://localhost/myfolder/index.php), Firefox prompts me with "what should Firefox do with this file?"

I'm at a loss - why doesn't Firefox know how to open a php file? I browse to php files all the time on web pages, so why not on localhost?
My site: reNkai
renkai
Level 1
Level 1
 
Posts: 13
Joined: Sun May 20, 2007 5:56 pm

Linux Mint is funded by ads and donations.
 

Postby Ede on Wed Jun 27, 2007 12:33 am

Edit: Disregard what I said. No sleep for 30 hours, I mixed up windows and linux. >_>

No more x-files before I'm going to sleep!
Last edited by Ede on Wed Jun 27, 2007 5:59 am, edited 1 time in total.
User avatar
Ede
Level 4
Level 4
 
Posts: 294
Joined: Thu Jun 14, 2007 7:02 pm
Location: Norway

Postby speaker219 on Wed Jun 27, 2007 1:14 am

That means the scripts aren't being parsed, just delivered as regular text files.
I reccomend using XAMPP (an easy-to-install combo of Apache/PHP/mysql)
It automatically configures everything so that it works right away.
Once it is installed if you only want to use the Apache + PHP part, you can delete the other parts =)
here is the howto
http://ubuntuforums.org/showthread.php?t=223410
speaker219
Level 2
Level 2
 
Posts: 56
Joined: Tue Jun 19, 2007 4:54 pm

Postby scorp123 on Wed Jun 27, 2007 3:16 am

Ede wrote:Are you sure that php5 is running as a service?
Please, if you don't know what you are talking about .... :lol:
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Re: how to run php on localhost?

Postby scorp123 on Wed Jun 27, 2007 3:17 am

renkai wrote:I'm missing something. I have apache2 installed and I have php5 installed
Did you enable mod_php in your Apache main configuration? I'd suggest you check the documentation and how-to's on www.apache.org ...
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland


Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], Lemuel111, Mute Ant and 32 guests