1
votes

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.

4
google for and download WAMP, which is the "shrink-wrapped" version of apache, mysql, php for windows. All you need is the c++ redistributable and it will give you a link to it on the downoad page if you don;t already have iit.I wrestled a bear once.
Thanks for WAMP which I didn't know about and seems to work but I need a PHP that works with my existing installation of Apache (I could have made that clearer I guess). I'll look into migrating my existing installation to WAMP but I would still prefer an independent installation of PHP.user1476044
Do you install the Apache 2.4 from apache Lounge? By the way i suggest to everybody to install PHP hard way at least one time.ontananza
You have LoadModule php5_module "c:/php/php7apache2_4.dll" Is it as simple as the missing directory seperator i.e. LoadModule php5_module "c:/php/php7/apache2_4.dll"RiggsFolly
@pamblam No, I don't think I am misunderstanding anything. I already have an extensive web site using python scripts to access a database. If I migrate to a WAMP-based solution then all of that work has to be moved and re-tested. It would have been much easier (it seems to me) if PHP could have been simply added to my existing installation.user1476044

4 Answers

6
votes

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

you should change it to:

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

0
votes

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

0
votes

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
0
votes

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.