PHP4 and Apache2 and Windows XP - no success yet

Hi all,

I installed PHP4 and Apache 2 on my Windows XP machine, I created phptest.php file which contains
<? phpinfo(); ?>

But when I click on that WExplorer just wants to either open it or save it.

Obviously it does not process the file as PHP file.

Can you plz help?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


in your httpd.conf, you need to set your documentRoot directory, this is where all your PHP files should sit under.
DocumentRoot "C:/Program Files/Apache/Apache2/htdocs"

and also setup your # To use server-parsed PHP files
AddType application/x-httpd-php .php .php3 .php4 .phtml
If you are using php as a module rather than cgi you also need to add a line like this one:

LoadModule php4_module "c:/path/to/php/sapi/php4apache2.dll"

You can put it with the other LoadModule lines.
If you used the executable installer from (instead of the zip version) then you are using CGI and can disregard my post :)
do check again pls
In order to enable PHP to run on Apache
To enable php on apache
Open your httpd.conf file and look for the following lines:
LoadModule php4_module  
The above line loads the module.  Then you also need to have a line to tell it to process the .php file.  The line for this is:
AddType application/x-httpd-php .php
There should be sections for each of these lines.  
The AddType line is usually present, but commented (#) out.
You can also add more extensions that you want to process as well, like .php .php3 .php4 etc.
After adding these lines you need to restart your apache server.  
Good Luck

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
check out another good resources for PHP
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.