[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Apache 2.4 on Windows Showing PHP files as plain text

Posted on 2014-03-02
17
Medium Priority
?
1,677 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
[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
  • 8
  • 5
  • 4
17 Comments
 
LVL 59

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 59

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 59

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 59

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 84

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
 
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 59

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 84

Accepted Solution

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

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 84

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

656 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