Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Apache 2.4 with PHP 5.6

Posted on 2014-11-12
5
Medium Priority
?
2,172 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 84

Accepted Solution

by:
Dave Baldwin earned 1500 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 84

Expert Comment

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

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

722 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