Page 1 of 1

problem for php enviroment on winXP

Posted: Sat Mar 20, 2010 10:44 pm
by sdnd2000
Hi, I am beginner and starting to config the windows environment. I just download PHP5.3.2 and apache 2.2. I followed the instruction to config everything. But when I used localhost to test php file, the browser just wanted download it. I do not know why. Thanks for telling me.

Re: problem for php enviroment on winXP

Posted: Sun Mar 21, 2010 8:03 am
by mikosiko
most likely your apache configuration is incomplete... in the apache configuration file look for the directive
DirectoryIndex it probably is written in this way:

DirectoryIndex index.html just add index.php

also in the same configuration file look around the end of it and be sure that the PHP configurations lines has been included (3 or 4 lines)...

check everything and after that restart apache and test

Re: problem for php enviroment on winXP

Posted: Sun Mar 21, 2010 9:10 am
by sdnd2000
I just changed a little bit. Now the browser just displayed php code not executed. why is that. Thank you

Re: problem for php enviroment on winXP

Posted: Sun Mar 21, 2010 10:29 am
by Eran
Setting the DirectoryIndex is just a convenience method, it is unrelated to parsing PHP. You need to load the PHP module provided by your PHP installation -

Code: Select all

PHPIniDir "/php/directory/here"
LoadModule php5_module "/path/to/php5apache2_2.dll"
You would have had much easier time if you had downloaded the executable installer for PHP which does this for you.