Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just clean installed Apache 2.2.17 and PHP 5.3.4. For Apache selected Win32 installer, for PHP I selected x86 VC6 Thread Safe due to this, and I put Apache in C:\web\Apache2.2, and PHP in C:\web\libraries\PHP.

The thing is every time I try to hit a PHP page on localhost, I get this entry in my log files:

[Thu Dec 16 11:54:02 2010] [error] [client] File does not exist: C:/web/htdocs/web, referer: http://localhost/

DocumentRoot is C:\web\htdocs, and it works fine for normal .html files (it works!). But it seems Apache is redirecting all requests for .php pages.. to a subfolder called /web of htdocs. I don't get it.

All the PHP installer did was in httpd.conf:

ScriptAlias /php/ "C:/web/libraries/php/"
Action application/x-httpd-php "C:/web/libraries/php/php-cgi.exe"

And mime.types:

application/x-httpd-php php
application/x-httpd-php-source  phps
share|improve this question


LoadModule php5_module "C:/web/libraries/PHP/php5apache2_2.dll"

Looks like the PHP people messed it up.

To get the ScriptAlias line above, I actually selected "Apache 2.2.x Module" in the PHP installer but it looks like it added PHP-CGI directives which was not what I want.

So naturally I chose "Apache CGI" to get it to configure for "Apache 2.2.x Module" ;)

Here's what I have in httpd.conf now:

PHPIniDir "C:/web/libraries/PHP/"
LoadModule php5_module "C:/web/libraries/PHP/php5apache2_2.dll"    
AddType application/x-httpd-php .php

I'm not sure if this is entirely correct, but it works.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.