Re: [PHP] PHP4 to PHP5 issue



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@xxxxxxxxxxxxxxxxxx
(866) 813-4603 x605
.



Relevant Pages

  • Re: [PHP] PHP4 vs PHP5 Performance?
    ... PHP5 being faster than PHP4 is greatly dependent on what features you ... I've consistently found PHP4 to be faster for my purposes also. ... I've been doing a lot of benchmarking with Apache to compare ... Also PHP on Apache1 was much faster than on Apache2. ...
    (php.general)
  • Re: PHP4 and PHP5
    ... Is it posible to run apache with PHP4 and PHP5 on different virtual ... for Multilingual Web Sites, Web Designs) ...
    (php.general)
  • Re: prob. w. wordpress + php5
    ... But WordPress, in particular the Textile 2cb plugin, has a bug in it using php5 that makes enumerated lists come out wrong. ... I have the version of sid with apache + php4 on a mirror. ...
    (Debian-User)
  • Re: [PHP] PHP4 to PHP5 issue
    ... Apache installation and run PHP4 and PHP5 concurrently. ... AddType application/x-httpd-php .php ...
    (php.general)
  • Re: [PHP] PHP 5.2.3 - Segmentation fault (core dumped)
    ... and if you don't plan on trying to use php4 and php5, ... looking for php4 too. ... DirectoryIndex index.php index.php3 index.html ...
    (php.general)