Welcome to WebmasterWorld Guest from 54.160.163.163

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Can I run multiple versions of PHP on Apache?

     

bill

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

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

bill

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

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



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

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

WebmasterWorld Senior Member Top Contributors Of The Month



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month