Solved

Apache 2.4 with PHP 5.6

Posted on 2014-11-12
5
2,002 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 35

Expert Comment

by:gr8gonzo
ID: 40438940
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
ID: 40438958
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 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40438987
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
ID: 40443099
Thanks, I went with 2 versions.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40443247
You're welcome, glad to help.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 i…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

617 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