Re: PHP4 to PHP5 issue

From: Date: Wed, 07 Feb 2007 15:42:48 +0000
Subject: Re: PHP4 to PHP5 issue
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-248495@lists.php.net to get a copy of this message
On Feb 5, 2007, at 2:00 PM, Jochem Maas wrote:
you don't need to use the box - you can install a 2nd copy of apache and run php4 on it and use the apache ProxyPass directive to make the php4/apache setup available via the apache(2)/php5 [std] webserver. search the archives for 'ProxyPass'
You actually don't even have to run a second instance of Apache. From what I've heard of other hosting companies doing, you can use the same Apache installation and run PHP4 and PHP5 concurrently. However, the only thing you'd have to do is one of the following: 1) For PHP4 apps and scripts, leave the .php extension and rename all PHP5 apps and scripts with a .php5 extension. Where you have the string: DirectoryIndex index.php index.html add: index.php5 to it. And where you have the string: AddType application/x-httpd-php .php Change it to: AddType application/x-httpd-php4 .php Also, add another line: AddType application/x-httpd-php5 .php5 Make sure you include both the php4 and php5 modules, restart apache and voila! PHP4 and PHP5 on the same server using 1 installation of Apache. 2) Do the same as above, but use .php4 extensions instead of .php5. 3) Additionally, after doing 5 minutes of Googling, I found that you can have .htaccess files to control which applications use PHP4 and which use PHP5 with the following directive: AddHandler application/x-httpd-php5 .php This would circumvent having to rename the extensions of your PHP files, as you could then do directory specific PHP4/5 app running. You still have to make certain Apache has both the PHP4 and PHP5 modules loaded, obviously. -- Christopher Weldon President & CEO Cerberus Interactive, Inc. cweldon@cerberusonline.com (866) 813-4603 x605

« previous php.general (#248495) next »