x64 VC11 builds of PHP5 and Apache2 not playing nice on Windows

Here is the Apache I am using: http://www.apachelounge.com/viewtopic.php?p=24281 (httpd-2.4.4-win64-VC11.zip)

And here is the version of PHP I am using: http://windows.php.net/download/ (VC11 x64 Non Thread Safe (2013-Jun-20 02:50:14))

My php.ini is configured correctly, as is httpd.conf, however after I add the following lines to get Apache to load PHP:

PHPIniDir "c:/php5" 
LoadModule php5_module "c:/php5/php5.dll" 
AddType application/x-httpd-php .php .php5 

I get the following error when I try to start the server:

Syntax error on line 527 of C:/Apache24/conf/httpd.conf: Can't locate API module structure `php5_module' in file C:/php5/php5.dll

I don’t get what’s wrong, I have the 64-bit versions of PHP and Apache, and they are both compiled using VC11. Why doesn’t Apache like PHP’s dll file?


You are most likely using the wrong DLL. Usually there will be a php5apache2_2.dll or a php5apache2_4.dll which expresses the SAPI for apache and is usable as an apache module.

That said, you really should avoid WAMP stacks for many, many reasons: linux is effectively the primary development and support OS for both apache and php, and historically dev involvement in windows-only bugs and issues is scant. Moreover, the licensing costs for linux are lower, as is the performance overhead.

Source : Link , Question Author : Cameron Ball , Answer Author : Falcon Momot

Leave a Comment