not showing the php page!

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
parachuter2b
Forum Newbie
Posts: 9
Joined: Thu Jun 11, 2009 12:04 pm

not showing the php page!

Post 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
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: not showing the php page!

Post 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"
parachuter2b
Forum Newbie
Posts: 9
Joined: Thu Jun 11, 2009 12:04 pm

Re: not showing the php page!

Post by parachuter2b »

I had those lines in the httpd.conf file, but not working
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: not showing the php page!

Post 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.
parachuter2b
Forum Newbie
Posts: 9
Joined: Thu Jun 11, 2009 12:04 pm

Re: not showing the php page!

Post 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
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: not showing the php page!

Post 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.
Post Reply