PHP 4 and PHP 5 on the same server

liunx

Guest
Hi,

Does anyone have PHP4 and PHP5 installed on the same server? My developers say it is not working or if it is it will introduce errors. If I only install PHP5 I was told I get no performance updates because it has to be installed in a way to simulate PHP4 because we have hundreds of scripts that use php5 and are not optimized for the version 5.
I think for me the best solution is to have both so I keep the old scripts with PHP 4.3 and use for everything New the PHP5 installation. I would be thankful for any help and if someone could point me in the right direction so I can see if it is possible to have 2 PHP and what it takes to do this reliable.

Best wishes,
thomi think i saw it somewhere that you can install the two version as a module of Apache server...Of course you can run both versions on your server. If you have PHP4 files that don't work with PHP5, it's probably not because of things you used from PHP4, but PHP3. PHP4 is almost entirely compatible with 5, through deprecated functions of course. Correct me if I'm wrong though, cause...I'm finding that happens more and more often. o_OI wouldn't co-mingle PHP4 and PHP5 on the same server whether it is for development or production environments. At some point, you have to make a commitment for the future. I would rather play it safe and not monkey around with what just works.

Thus, find another box and put PHP5 on it. This way there is no question whatsoever what is running on what version and what box.

Consider the delimna server hosting companies have. Here they have a lot of customers running PHP4 applications. These applications come from commercial and open source. I would think that it would be unwise to take the risk of trying to forcefully transition existing customers with PHP4 applications onto the same server with PHP5 installed. To pull the rug out of you and replace their PHP4 base with PHP5 and putting the responsibility back on the website owners is a sure fire way to lose customers. Not all website owners know how to program in PHP. Not all applications will "just work".

The lowest risk is to have separate servers - PHP4 and PHP5 servers. If you don't have money to afford another box, then go find a PHP5 hosting company and pay a few bucks a month.hmm... I think that for development testing, if you compile PHP4 and PHP5 for different php.ini file locations, and perhaps use .php4 for PHP4 and .php5 for PHP5, and install them as modules, it should be possible to run both separately on the same server.
Probably isnt a good idea for a production server though, since most scripts tend to use a .php extension, hence there would be no way to differentiate between PHP4 and PHP5.
 
Back
Top