PHP is not working

I set up the Apache web server with the php4apache2.dll but when I ejecute a php file (phpinfo.php) is does display a web page is asked me if I want to open or save the file.

I believe I miss some configuration...the Apache is running OK

Regards,
rtorresmtzAsked:
Who is Participating?
 
matt_mcswainCommented:
Is your document root set properly in php.ini. Something like:

doc_root = c:\apache\apache2\htdocs

If you type

apache -k restart

from the command line, are there any errors? what are they?
Have you tried filemon before-->http://www.sysinternals.com/ntw2k/source/filemon.shtml
You run it when you restart apache, and capture everything any process is trying to access and possibly see where the failing is. Sometimes there are permissions issues any one or more files.

You can also try running as a cgi; you probably just need to uncomment these lines in httpd.conf

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"

0
 
rtorresmtzAuthor Commented:
Correction "when I ejecute a php file (phpinfo.php) ITdoes NOT display a web page IT asked me if I want to open or save the file.
0
 
matt_mcswainCommented:
Do you have these two lines in your httpd.conf?

LoadModule php4_module "c:/php/php4apache.dll"
AddType application/x-httpd-php .php

Obviously if your path is different for the first line, change it accordingly.
And restart apache.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
matt_mcswainCommented:
You probably noticed this, but it should be:

LoadModule php4_module "c:/php/php4apache2.dll"
0
 
rtorresmtzAuthor Commented:
I already add this two lines you mentioned.

LoadModule php4_module "c:/php/php4apache2.dll"
AddType application/x-httpd-php .php

And also I add this line:
PHPIniDir "C:/php"
0
 
rtorresmtzAuthor Commented:
Correction: "add" "added"
0
 
matt_mcswainCommented:
Did you have php working before?
Is php4ts.dll in your system path(i.e. c:\windows\system32)?
Have you tried putting your php.ini in your c:\windows directory?
0
 
matt_mcswainCommented:
You can always try xampp-->http://www.apachefriends.org/en/xampp-windows.html
which is php/apache/mysql, and tons of other optional packages that are all in one easy installer.
0
 
rtorresmtzAuthor Commented:
Yes I have the php4ts.dll in the c:\windows\system32) and
 php.ini in the c:\windows directory?
0
 
rtorresmtzAuthor Commented:
I decide to uninstall every thing and I´m installing with the xammp you recommend..

Thanks
0
 
matt_mcswainCommented:
You chose the hardest for windows; the one I use as well when I'm using Windows.;)
Installing php with IIS is trivial; usually running the installer does it.
Installing php as a cgi with apache is easier because there are less dependencies.
But both are less secure.
Apache is the best web server in the world; it just doesn't always get along with Windows.

Good luck.
0
 
rtorresmtzAuthor Commented:
Matt I didn´t make it with the xammp but I install Apache, PHP and MySQL manully one by one and it appear working

Thank you very much for your help...
0
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.

All Courses

From novice to tech pro — start learning today.