Solved

Apache 2.4 with PHP 5.6

Posted on 2014-11-12
5
1,597 Views
Last Modified: 2014-11-14
I have a Win 2012R2 server with IIS port 80 running with PHP 5.6.0 installed using the Web platform installer.
Now I am setting up Apache 2.4 port 85 and need to make it work with PHP also.

My PHP install didn't have the php5apache2_4.dll so I downloaded it from http://windows.php.net/download/
Both Are 32bit.
I added this to my apache config but I cant start the apache with this code in there.

LoadModule php5_module "C:/Program Files (x86)/PHP/v5.6/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/Program Files (x86)/PHP/v5.6"

Open in new window


I see lots of people having issue with this, telling them cant find DLL file but its clearly in that folder and correct type.

The only difference is that my PHP is 5.6.0 and the download where I got the php5apache2_4.dll is 5.6.2
The error is misleading, its not saying its a wrong file or what ever. Its saying dll is not there but it is.

Can I even run Apache and IIS using the same PHP install?

Thanks
0
Comment
Question by:baysysadmin
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:gr8gonzo
Comment Utility
Usually, the missing DLL errors are not talking about the php5apache....dll file. Some of the different extensions in PHP also have dependencies on different DLL files. If those dependencies aren't found, you'll get an error about a missing DLL, too.

So start by editing your C:/Program Files (x86)/PHP/v5.6/php.ini file and making sure that ALL extensions are commented out. Save the file and try to start the web server again and see if you still get missing DLL file errors.

Also, in a pinch, you can use Procmon from Microsoft to watch the filesystem activity and you'll be able to see what files PHP is looking for when it loads up, and it'll tell you whether it's successful or not. The tool generates a lot of data, so it takes a bit of patience to filter down the results to find what you're looking for it, but it works.
0
 

Author Comment

by:baysysadmin
Comment Utility
I figured it out.
It was a version mismatch.
I downloaded PHP 5.6.2 and it loaded fine.
I then found 5.6.0 on that site but that one didn't have php5apache2_4.dll either.
I think 5.6 is windows only, and 5.6.2 has apache support.
And as tested above the dll from 5.6.2 wont load with 5.6.0

I think you are right, Ill have to compare the php configs between the 2 version and see why one loads the other doesn't.
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
Can I even run Apache and IIS using the same PHP install?
Generally No.  Apache uses the TS or Thread safe version of PHP and IIS requires the NTS or Non-Thread Safe version.  Version mismatches can also be a problem but the TS/NTS version is a bigger problem.

So you should have two different versions of PHP with two separate 'php.ini' files.  I always put PHP in C:\PHP so there are no spaces in the path.  On the machine where I have two versions, one for Apache and one for IIS, I have C:\PHP and C:\PHPts.
0
 

Author Comment

by:baysysadmin
Comment Utility
Thanks, I went with 2 versions.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
You're welcome, glad to help.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now