Link to home
Start Free TrialLog in
Avatar of ParadiseITS
ParadiseITS

asked on

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?
Avatar of Cliff Galiher
Cliff Galiher
Flag of United States of America image

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.
Avatar of ParadiseITS
ParadiseITS

ASKER

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?
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,
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?
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.
*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/
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.
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.
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.
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.
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.
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.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
DaveBaldwin - thank you for your assistance!
Thanks
You're welcome, glad to help.  Makes it easier when I have a working version here.