Solved

Apache 2.4 on Windows Showing PHP files as plain text

Posted on 2014-03-02
17
1,435 Views
Last Modified: 2014-03-02
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?
0
Comment
Question by:ParadiseITS
  • 8
  • 5
  • 4
17 Comments
 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 39898748
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
 
LVL 9

Author Comment

by:ParadiseITS
ID: 39898751
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
 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 39898769
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
 
LVL 9

Author Comment

by:ParadiseITS
ID: 39898778
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
 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 39898786
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
 
LVL 9

Author Comment

by:ParadiseITS
ID: 39898817
*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
 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 39898837
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39898915
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
Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

 
LVL 9

Author Comment

by:ParadiseITS
ID: 39898927
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
 
LVL 9

Author Comment

by:ParadiseITS
ID: 39898930
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
 
LVL 9

Author Comment

by:ParadiseITS
ID: 39898949
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
 
LVL 56

Expert Comment

by:Cliff Galiher
ID: 39898941
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
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39898944
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39898950
0
 
LVL 9

Author Comment

by:ParadiseITS
ID: 39898957
DaveBaldwin - thank you for your assistance!
0
 
LVL 9

Author Closing Comment

by:ParadiseITS
ID: 39898962
Thanks
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39899004
You're welcome, glad to help.  Makes it easier when I have a working version here.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Folder NTFS Permissions 14 68
Paging Using PHP 7 32
regex expression 9 22
Datepicker in PHP 8 0
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

757 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now