Page 1 of 1

not showing the php page!

Posted: Tue Jun 16, 2009 4:02 pm
by parachuter2b
Hi,

I followed the following tutorial to setup php and configure apache with php:

http://www.sebastiansulinski.co.uk/tuto ... windows_xp

and as the guide suggests: created a file called: phpinfo.php in C:\webserver\htdocs with the following content:
<?php
phpinfo();
?>
but http://localhost/phpinfo.php doesn't show the php config page. It rather only shows:

<?php
phpinfo();
?>

do you know why this is?

Thanks,

parachuter2b

Re: not showing the php page!

Posted: Tue Jun 16, 2009 5:24 pm
by califdon
Yes, that's a sure symptom that Apache isn't configured to recognize PHP file extensions, or can't find the PHP directory on your computer. If you installed PHP and Apache independently (as contrasted with installing a package like WAMP or XAMP, that install everything at one time), you need to make (usually) 2 changes in your httpd.conf file. The file is probably in a directory named conf, under your Apache installation directory. It should contain lines like the following. If it doesn't, you will have to add them (modified according to your installation, of course).

Code: Select all

PHPIniDir "C:/Program Files/PHP/"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"

Re: not showing the php page!

Posted: Wed Jun 17, 2009 11:00 am
by parachuter2b
I had those lines in the httpd.conf file, but not working

Re: not showing the php page!

Posted: Wed Jun 17, 2009 1:03 pm
by califdon
parachuter2b wrote:I had those lines in the httpd.conf file, but not working
And did you verify that the exact .dll filename really IS in that exact directory? And that the PHP.ini file really IS in the directory shown? If so, I'm at a loss to explain why Apache wouldn't interpret your PHP code.

Re: not showing the php page!

Posted: Wed Jun 17, 2009 2:22 pm
by parachuter2b
thanks a lot ! did work! stupid mistake: i had a '#' sign before every line that I had added to httpd.conf, so guess they were all being commented out lol

Re: not showing the php page!

Posted: Wed Jun 17, 2009 2:29 pm
by califdon
Glad you got it working. Yes, # means the beginning of a comment line. It happens. I wish I could forget all the stupid mistakes I've made.