ONYX
ONYX

Reputation: 5859

Apache fails to restart after PHP installation

I've installed Apache2 on port 81 since IIS7 uses port 80. It loads fine and show me the directory when I load it through the browser but after installing PHP5 with msi installer Apache fails to restart because of an error in httpd.conf it says it can't load the php5apache2_2.dll I get this error after doing a repair on Apache httpd.conf

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:\Webserver\php\"
LoadModule php5_module "C:\Webserver\php\php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

Here is what the error is.

cmd line error: Syntax error on line 970 of C:/Webserver/apache/Apache2/conf/httpd.conf":
Cannot load C:/Webserver/php/php5apache2_2.dll into server
%1 is not a valid Win32 application

Upvotes: 3

Views: 9564

Answers (3)

Prosenjit
Prosenjit

Reputation: 459

You need MS Visual C++ 64 bit(vc_redist.x64.exe), 64 bit Apache Binary(httpd-2.4.18-win64-VC14.zip) and 64 bit PHP (php-5.3.2-Win32-VC9-x64.zip). I tried with PHP 7 64 bit but not successful. Then used this PHP(php-5.3.2-Win32-VC9-x64.zip) it worked. All for 64 bit Windows 7 Thanks

Upvotes: 0

gmarshall
gmarshall

Reputation: 31

I had the same issue. I googled and found a 64bit version of the PHP binary for Windows here:

http://www.anindya.com/php-5-3-2-x64-64-bit-windows-binary/

Upvotes: 3

Brett Freer
Brett Freer

Reputation: 266

Are you sure the PHP image matches your PC - ie 32/64 bit?

Upvotes: 2

Related Questions