user1476044
user1476044

Reputation: 396

Which versions/libraries do I need to get PHP running on Win 7 with Apache 2 (64bit)?

I have been having trouble getting PHP to install on my 64-bit Win 7 machine with Apache. I'm new to installing software that doesn't come shrink-wrapped and I have run out of useful docs/links to read.

Here is what I have done:

  1. Installed Apache 2.4.18 win64 (which is built with VC14) from Apache Lounge. This works - my browser says "It works!" when I visit my docroot.
  2. Downloaded the VC14 x64 Thread Safe (2016-Jan-06 23:30:09) PHP zip from windows.php.net and extracted it to c:/php.
  3. Added LoadModule php5_module "c:/php/php7apache2_4.dll" to httpd.conf.
  4. Downloaded VC_redist64.exe (version 14.0.23506) from Microsoft and installed it.
  5. Tried httpd and I get:

    c:\Apache24\bin>httpd httpd: Syntax error on line 178 of C:/Apache24/conf/httpd.conf: Can't locate API module structure `php5_module' in file C:/php/php7apache2_4.dll: No error

I know I need to add/adjust more in httpd.conf and perhaps php.ini too, but all the help I have found on the web suggests that the problem is elsewhere.

Upvotes: 1

Views: 4514

Answers (4)

user14322245
user14322245

Reputation: 1

I looked all over the internet to get this fixed ... it was just a case-sensitive thing. I changed mine to:

LoadModule php7_module "c:/php/php7apache2_4.dll"

and it fixed the issue.

Upvotes: 0

altinturk
altinturk

Reputation: 147

You're using PHP7, VC14. So instead of php5_module, use

LoadModule php7_module "c:/php/php7apache2_4.dll"

Result:

c:\Apache24\bin>httpd -t
Syntax OK

Upvotes: 0

Ehsan Mohammadbeiglou
Ehsan Mohammadbeiglou

Reputation: 101

LoadModule php5_module "c:/php/php7apache2_4.dll"

you should change it to:

LoadModule php7_module "c:/php/php7apache2_4.dll"

Upvotes: 6

user1476044
user1476044

Reputation: 396

I replaced the LoadModule with a directive to load php5apache2_4.dll from the Wamp distribution and there seem to be no problems.

Upvotes: 0

Related Questions