4
votes

I am trying to set up php 5.5.10 with apache(httpd 2.4.7) on Windows 8 64 bit system

Added following lines to httpd.conf

LoadModule php5_module "c:/apps/php/php5apache2_4.dll"
PHPIniDir 'C:/apps/php'
AddHandler application/x-httpd-php .php

I get the following error. httpd.exe: Syntax error on line 179 of C:/apps/Apache24/conf/httpd.conf: Cannot load c:/apps/php/php5apache2_4.dll into server: The specified module could not e found.

Without php modules config apache starts fine. But when I add php module I get this error. I use thread safe php and php5apache2_4.dll is actually present in the specified location.

I also add C:/apps/php to my windows path as suggest in a thread. I also used php.ini-production and changed name to php.ini I did not make any further changes to php.ini

Any pointers on how to resolve this issue?

2
What is the VC distribution number you used to install apache?Ohgodwhy
Are these x86 or x64 builds?Steven Martin
Both Apache and PHP are x86 builds. I used Visual Studio 2008 (VC9) build for Apache serverSai Gadde
@Ohgodwhy Thanks for the pointer. Using VC11 build of apache solved this issue for me. I also installed VC11 Redistributable metioned in readme_first.htmlSai Gadde

2 Answers

1
votes

Check SRVROOT in httpd.conf file, it should point to the root folder of your Apache installtion and not the htdocs folder.

Example config, this are the first lines in my config:

Define SRVROOT "D:/Server/Apache24/"
ServerRoot "${SRVROOT}"
0
votes

Had the same problem. The file was there but Apache complained that it can't find the module.
You probably have to "install prior versions of the VC Redistributable since later versions do not cover earlier ones".

See this answer: https://stackoverflow.com/a/42724749/2016386

In my case the error disappeared after installing Visual C++ Redistributable 2012 and 2015.