I'm sure that this is a fairly simple problem to solve, but I've already spend way too many hours without any clue. I've also read the manual on the php website, bought a book, browsed the internet and these forums for any sort of solution. So all-in-all, I have spent at least 10+ hours trying to fix this problem. I apologize for the disclaimer, but I just want to show that I have done my best in attempting to fix the problem on my own before posting.
I have installed PhP/5.1.4 on my machine which is running Apache/2.0.58 as a module. I created a page title phpinfo.php, so that I can access it through the localhost (http://localhost/phpinfo.php). But everytime that I try to acess that page, I get the message "Not Found" "The requested URL /phpinfo.php was not found on this server. I checked my error logs on Apache, and it states "Script 'C:/Program Files/Apache Group/Apache2/htdocs/phpinfo.php' not found or unable to sta[r]t". According to the faq on the php site, it states that there is a configuration problem with apache which is why it is not able to open/start any php files. I even typed in some php on my index.html page that automatically comes up whenever I acess my server through a broswer; no php displays, but I can view the code by doing a view source. From the command line, I have also done php -i which displays a ton of information, but most importantly shows that php is correctly installed. I also tried to configure PhP as a cgi, but without any luck.
On my machine, I just reinstalled windows xp home yesterday; so everything on the machine is new. I downloaded Apache 2.0, and I can access the "It works" page using my browser. I also downloaded Mysql server 5.0, then PhP 5.1; besides firefox, these are the only programs on the machine. I have yet to test any part of mysql since what I have read states that I need php working first. As far as how I have configured PhP, I placed the php.ini file in windows, configured it according to the website. I also placed Loadmodule php5_module "C:/php/php5apache2.dll", Addtype application/x-httpd-php .php, and PHPIniDir "C:/php" in the Apache httpd.conf file (along with restarting Apache and clearing out my browser). I don't know if there is any sort of special permission that has to be set, but as far as I can tell with all of this- Apache just isn't seeing php for some reason.
Any help would be appreciated.
Configuring PhP5.1 on Apache 2.0
Moderator: General Moderators
It sounds like your PHP install is good, and it sounds like your Apache install is good. However Apache probably doesn't know that PHP exists on your system, or where it resides for that matter.
Now what you'll need to do is locate your httpd.conf file. (Normally located at: C:\Program Files\Apache Group\Apache2\conf\httpd.conf)
and add the following three lines to it:
LoadModule php5_module php/sapi/php5apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Once you do that, restart Apache. ( Start > Programs > Apache HTTP Server 2.0.58 > Control Apache Server > Restart ) and you should be good to go.
Now what you'll need to do is locate your httpd.conf file. (Normally located at: C:\Program Files\Apache Group\Apache2\conf\httpd.conf)
and add the following three lines to it:
LoadModule php5_module php/sapi/php5apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Once you do that, restart Apache. ( Start > Programs > Apache HTTP Server 2.0.58 > Control Apache Server > Restart ) and you should be good to go.