homepage Welcome to WebmasterWorld Guest from 54.234.2.88
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Can I run multiple versions of PHP on Apache?
bill




msg:4590427
 3:56 am on Jul 5, 2013 (gmt 0)

I have not done much research into this yet, but hope someone here might be able to provide some advice.

I have a production FreeBSD server running Apache and it is running PHP 5.2.17 as an Apache module. The company that developed a CMS for me on this server cannot guarantee that it will work on newer versions of PHP.

I need to run a few other CMS packages for upcoming websites. However, these packages are suggesting PHP 5.3.x or 5.4.x as a minimum requirement.

Is there a way I can run more than one version of PHP at the same time on Apache?

 

phranque




msg:4592937
 5:09 am on Jul 14, 2013 (gmt 0)

you can probably run one version as mod_php and the other as FastCGI.

bill




msg:4594069
 2:11 am on Jul 18, 2013 (gmt 0)

The more I look into this the more I think I had better just make a VM to develop on other versions of PHP. I don't want to get too far into uncharted waters with my production machine.

phranque




msg:4594131
 6:28 am on Jul 18, 2013 (gmt 0)

you could probably bend your server into a pretzel and run up to 4 versions of PHP simultaneously.
Serving PHP with Apache: AddType and AddHandler:
http://www.webmasterworld.com/apache/4557229.htm [webmasterworld.com]

(just because you can doesn't mean you should)
=8)

lucy24




msg:4594188
 9:00 am on Jul 18, 2013 (gmt 0)

The company that developed a CMS for me on this server cannot guarantee that it will work on newer versions of PHP.

Can you pin them down to any details? php is not the most backward-compatible language in the world, so at bottom we're talking about specific commands or functions that may no longer work. This is already a warning sign, because generally when something is deprecated-- in any environment-- it's because there is something wrong with it. Or, at least, that the alternatives are so much better that they're trying to sweep the old version under the rug.

See if you can back your developers into a corner and find out (a) what, exactly, might no longer work as intended and (b) why it can't be changed to something that does still work.

JD_Toims




msg:4595161
 2:11 am on Jul 22, 2013 (gmt 0)

It is possible, because I've had hosts with both php4 and php5 running before.

I haven't looked into the entire process, but I've installed PHP on a server before and you should be able to install two version as long as you set the location of the installations to different locations (they should be different anyway afaik), set the locations of the ini files to different places and then use different extensions on URLs combined with <FilesMatch "\.your_php4_ext"> -> AddHandler/AddType for php4 + <FilesMatch "\.your_php5_ext"> -> AddHandler/AddType for php5 in the httpd.conf or something along those lines...

Been a while since I've set up a server, so I don't remember off the top of my head all the necessary settings you'll have to change to keep the two separate when you do the installation, but I'm sure it can be done.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved