Solved

Apache 2.4 with PHP 5.6

Posted on 2014-11-12
5
1,879 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

738 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