Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2322
  • Last Modified:

Apache 2.4 with PHP 5.6

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
baysysadmin
Asked:
baysysadmin
  • 2
  • 2
1 Solution
 
gr8gonzoConsultantCommented:
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
 
baysysadminAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
baysysadminAuthor Commented:
Thanks, I went with 2 versions.
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome, glad to help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now