httpd.conf? What do I edit to use PHP?

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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

httpd.conf? What do I edit to use PHP?

Post by Chris Corbyn »

Hi,

I've just installed apache and then installed php 4.3.6 on my windows xp machine. PHP installer prompted me to edit httpd.conf manually to use php with apache when it finished installing.

I'm a complete newbie to this so I just wondered which lines I need to change? I've got the document root and everything changed correctly it's just that when i try to view php pages I just get the source code...

Thanks in advance :-)
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

Code: Select all

ScriptAlias /php/ "c:/php/"
   AddType application/x-httpd-php .php
   Action application/x-httpd-php "/php/php.exe"
throw that in there and restart
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I get this error
Not Found
The requested URL /php/php.exe/files/mp3.php was not found on this server.
when I try to access http://localhost/files/mp3.php after adding that code?
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

hmmm... are you sure thats the right path to your php? c:/php/ check where its installed!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I changed that bit to
ScriptAlias /php/ "D:/Program Files/Apache Group/PHP"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
since I have php installed at

D:\Program Files\Apache Group\PHP
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Oh, just realised... I missed off the final "/" in my alias... that's what was going wrong. Fixed now... Thanks everyone! :-)
Post Reply