Storm Parker
Storm Parker

Reputation: 633

Installing PHP7 and Apache2.4 - php7apache2_4.dll error on Windows 10

Just got on a Windows 10 and after I configured my php.ini and http.conf I went on the command line httpd.exe and got this error message:

httpd.exe: Syntax error on line 530 of C:/Apache/conf/httpd.conf: Cannot load C:/php/php7apache2_4.dll into server: The specified module could not be found.

I KNOW this file is in that folder. I've installed both 64 bits version of PHP and Apache and I don't know what's going on.

Upvotes: 19

Views: 64660

Answers (7)

I had a similar issue and when i looked in the apache24 error log it said something about PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown etc. I had installed a version of vcredist but obviously it needed a more upto date version and found solution here: vcruntime140.dll 14.0 not compatible with PHP build

Upvotes: 0

Tom Rutchik
Tom Rutchik

Reputation: 1692

I'm not sure if this is the same problem, but I had an issue that the Apache httpd service would not start when I tried to add the php module to an apache server (httpd.conf). The service would not start. When I looked at the Event Viewer I found an application error event indicating that the service terminate unexpectedly, and it indicated that the problem occurred in Apache24\bin\libapr-1.dll.

The problem was with the LoadModule statement that I added at the end of my httpd.conf file. Here's what I orginally had:

LoadModule php7_module "C:\PHP7\php7apache2_4.dll"

Here's what I changed it to:

LoadModule php7_module C:\PHP7\php7apache2_4.dll

Low and behold, the apache service started, any I was able to execute the phpinfo.php sample script that I added to the Root Document directory. (By the way, forward or backward slashes both work.)

The difference is that I removed the quotes. The quotes were there because I had just copied and pasted from a web page that said how to install PHP.

Upvotes: 0

Matthew
Matthew

Reputation: 197

As the others said, the NON Thread safe (nts) does not support apache and u have to install thread safe versions

Upvotes: 2

Fabien Haddadi
Fabien Haddadi

Reputation: 2080

I was able to overcome this error by uninstalling my previous version of wampserver , then installing the latest version (3.2.0), closer to the php7.4.9 target.

As I previous had php 7.2 with an earlier version of wampserver (can't remember which), none of the above tricks would work for me. I was still getting the error of this topic title. Now working ok.

Reminder: to integrate an external version of php into wamp, rename php.ini-development in folder php7.4.9 into phpForApache.ini

Upvotes: 0

Atheek
Atheek

Reputation: 59

while you downloading PHP u should select ThreadSafe pack, Apache not supporting nonThreadSafe...

Upvotes: 5

Kumar
Kumar

Reputation: 907

Check whether you have installed Thread safe version of PHP. Non Thread safe version will cause this error.

You can download thread safe version of PHP here

Upvotes: 34

Kagome
Kagome

Reputation: 168

Which VC compiled version of Apache do you use? On php.net they recommend to use the apache server from apachelounge.com combined with the threadsafe php files.
Also make sure that you have installed the C++ Redistributable Visual Studio 2015.
If it still fails with that error make sure the user who is starting the process has access to the filesystem.

Upvotes: 0

Related Questions