Page 1 of 1

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

Posted: Thu May 27, 2004 8:22 am
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 :-)

Posted: Thu May 27, 2004 8:29 am
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

Posted: Thu May 27, 2004 8:35 am
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?

Posted: Thu May 27, 2004 8:40 am
by magicrobotmonkey
hmmm... are you sure thats the right path to your php? c:/php/ check where its installed!

Posted: Thu May 27, 2004 8:43 am
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

Posted: Thu May 27, 2004 8:44 am
by Chris Corbyn
Oh, just realised... I missed off the final "/" in my alias... that's what was going wrong. Fixed now... Thanks everyone! :-)