Apache 2.4 on Windows Showing PHP files as plain text

I have a Windows 2008 Server running Apache 2.4.7 with PHP 5.3.28  for Windows installed but my PHP pages are showing up in text.

I have configured PHP as directed, but I am used to loading a php module in Apache.  According to Apache Lounge you no longer have to do that and the module for 2.4.7 seems nowhere to be found online.

Can someone help with this conundrum?
LVL 9
ParadiseITSAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Cliff GaliherCommented:
I no longer use apache lounge's binary builds, but last I did, PHP was not included, nor did I spot that in their release notes. Unless you can link or provide a specific citation otherwise.


So with that in mind, I believe you'll have to still grab a windows build of PHP and configure it. The 2.4 build works for all 2.4.x versions of Apache.
0
ParadiseITSAuthor Commented:
That's interesting, because PHP says to specifically use Apache Lounge's build...  

Does the standard Apache 2.4 for Windows include the PHP module to load in the httpd.conf?
0
Cliff GaliherCommented:
No. And I believe you are misunderstanding the php.net page. The left sidebar is saying you should use the APACHE BUILD from apache lounge. It says nothing of the PHP build. What they mean by that is that if you download another build from another site (apache.org lists several) then the binary on the php.net website may not work. They are compiling their binaries against apache on apache lounge only. That doesn't at all mean (or imply) that it is included.

Now, if you are sticking to binaries, you have another problem. Apache 2.4.7 on apache lounge on VC11. But php.net's binary for 5.3.28 was compiled on vc9. That can cause stability issues and WILL require multiple C runtimes to maintain and patch. You'd be better choosing all one version of VC. That means changing your version of apache, changing PHP, or compiling yourself,
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

ParadiseITSAuthor Commented:
Right, that's what I said.  PHP is saying to use Apache Lounge's build of Apache.  You suggested to use the Apache build, I believe.  I have downloaded and installed Apache 2.4.7 from Apache Lounge and PHP 5.3 from PHP's Windows downloads page.

I'm not going to compile anything, I am going with the pre-built stuff.  I'm simply trying to help someone set up PHP Nuke on Windows (against my recommendations).  I've done this several times with Apache 2 and 2.2 and slightly older versions of PHP 5 with no trouble at all -- but they all had PHP DLL files to load in Apache's HTTPD.CONF file.

So does it sound like I need to seek out older versions of Apache and PHP to use?
0
Cliff GaliherCommented:
So now we are back to my original comment. You stated:

"I have configured PHP as directed, but I am used to loading a php module in Apache.  According to Apache Lounge you no longer have to do that"

I can find no reference to such a statement on php.net or apache lounge. You have to download the binaries (which it sounds like you have), install them, *and* load them. The whole "no longer need to load modules" is where it seems you got stuck and where my original comment was directed.
0
ParadiseITSAuthor Commented:
*Sigh*

You aren't really reading what I wrote.  You are only reading a portion of it.

I installed it exactly the way it directed.  And it does not reference editing the HTTPD.CONF file as I'm used to doing.  But this page below DOES.

In the past, I've had to load PHP modules in Apache.  THERE IS NO MODULE FOR PHP NOW.  If there is please direct me to it.

This link below shows a link to php5apache2_4.dll which is on Apache Lounge and the link no longer works.   Apache Lounge makes NO reference to this file existing.  Further down in the comments on this same page someone clearly says "it is included in the Windows binaries".  So that's where I'm having a problem...

The question is -- DO I NEED THIS FILE OR NOT.  And if I do -- where is it?

http://www.devraju.com/php/installing-php-5-4-with-apache-2-4-in-32-bit-of-windows/
0
Cliff GaliherCommented:
I can sigh louder than you!!

I read what you wrote. ALL of it. Now, let's cover a few basic (AND NEW) facts. Your link and your directions? Your latest comment is the first time you've posted that AT ALL, so sorry my psychic abilities failed to help you before now.

Oh, and by the way, that link isn't a php.net page or an apache lounge page. It is some random tutorial, but hey, it is on the internet, so it MUST be reliable and accurate, right?

Oh, and it was written for PHP 5.4, not PHP 5.3, and had you grabbed PHP 5.4 as that tutorial stated, you'd have had better luck. But I guess version numbers are as interchangeable as devraju is with php.net or apache lounge. It can't REALLY make an difference, can it??

-----

But despite all of that, and my frustration, and me being *this close* to telling you to take your lack of respect and go figure it out yourself, I'll help you. Cuz maybe you won't be such an arse the next time you ask a stranger for free help and remember this lesson.

If you want to run PHP 5.3 with Apache 2.4.7 using prevompiled binaries (which I will stress AGAIN I do not recommend because of the large VC and compilation gaps) you will want to follow the ACTUAL PHP.net manual configuration documentation. Not some tutorial. And specifically, because of the large version gap, you'll have to run it as CGI or FastCGI. You will not find a native module. But that part is at least okay because fastCGI is far more stable on windows than native modules are, even at 5.5.8 (and 5.5.9 so I've heard, but haven't tested yet.)

So there ya go. The file is missing because you are using versions different from the tutorial you found. Yes that is to be expected. And no, you don't need it. But you DO need to load and configure modules. It won't magically just work.
0
Dave BaldwinFixer of ProblemsCommented:
I have Apache 2.4 and PHP 5.4.8 running on Windows XP and what Cliff says about matching compiler versions is exactly right.  I'll go look up some more details in a minute when that machine finishes booting up.  All versions of PHP are sensitive to the compiler versions.  You can't mix extensions compiled with versions different than the main program used.
0
ParadiseITSAuthor Commented:
OK, thanks for the help but it is no help because as I've stated numerous times (thus my frustration with you not actually reading and comprehending what I'm writing) I followed the instructions which say I need the DLL.  The web page is something I turned to when the instructions did not work.

The answer here seems to be go back to an older version of everything since you don't seem to know the answer to my issue which IS THIS:

After following the instructions, I cannot find the DLL file.  When I turn to find it, it says that in 5.4 (which yes, I am using 5.3 because I did not see a compiled 5.4 version -- perhaps I missed it?) the DLL is in the binary.

You have not helped me in any real way here.  But thanks for the effort.

And this is hardly free help.  I pay for people to not read what I write when I ask for assistance.  Just because you don't get paid doesn't mean it is free.
0
ParadiseITSAuthor Commented:
Dave, I understand why you want to VC to match.  That's fine.  If it worked at all, I'd worry about that.  Right now, it doesn't work and Cliff hasn't helped me find what I need.  He has told me "don't do it that way" even though I am well aware you can run Apache 2.4 with PHP 5.3 successfully.  I've done it before with the DLL file loading in HTTPD.CONF -- I cna't find that.
0
ParadiseITSAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for ParadiseITS's comment #a39898930

for the following reason:

I guess no one can answer the actual question, so I'm closing it.
0
Cliff GaliherCommented:
You mean the PHP 5.4 on VC9 or PHP 5.5 binaries right on php.net?

http://windows.php.net/download/

Or perhaps you mean the answer I gave that you ignored that to run PHP 5.3, you'd need to configure CGI or FastCGI...which does NOT use a PHP DLL.

Right, one of us isn't reading. I'm done helping you. Good luck.
0
Dave BaldwinFixer of ProblemsCommented:
Ok, I'm running Apache/2.4.3 (Win32) PHP/5.4.8 both compiled with MSVC9 (Visual C++ 2008) .  I found the 'php5apache2_4.dll' in the 'modules' directory.  And in 'httpd.conf', you need:
LoadModule php5_module "c:/phpts/php5apache2_4.dll"
AddHandler application/x-httpd-php .php

Open in new window

where 'c:/phpts/' is your PHP directory.  Note the 'ts' for Thread Safe version of PHP.  I tried the NTS version and Apache did not like it.

PHP 5.4 download here: http://windows.php.net/download/
VC9 redistributable here: http://www.microsoft.com/en-us/download/details.aspx?id=5582
Apache VC9 downloads here:  http://www.apachelounge.com/download/additional/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
0
ParadiseITSAuthor Commented:
DaveBaldwin - thank you for your assistance!
0
ParadiseITSAuthor Commented:
Thanks
0
Dave BaldwinFixer of ProblemsCommented:
You're welcome, glad to help.  Makes it easier when I have a working version here.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.