Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 127.0.0.1] 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

1 Answer 1

Missing

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

 
discard

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.