Comments on Running Apache2 With PHP5 And PHP4 At The Same Time

Running Apache2 With PHP5 And PHP4 At The Same Time This tutorial shows how to install and configure Apache2 with PHP5 and PHP4 enabled at the same time. Because it is not possible to run both PHP5 and PHP4 as Apache modules, we must run one of them as CGI, the other one as Apache module. In this document I will use PHP5 as Apache module and PHP4 as CGI, and I will describe the setup for the Linux distributions Debian Sarge (3.1) and Ubuntu 5.10 (Breezy Badger).

4 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Anonymous

I have installed Debian Sarge 3.1 according your "perfect setup" including ISPConfig. If i like to extend this "perfect setup" with your how to "Running Apache2 With PHP5 And PHP4 At The Same Time" everything will work or not?

By: Anonymous

Check this out -> https://www.howtoforge.com/forums/showthread.php?t=2480

By: Anonymous

My recomendation would be better to use fastcgi feature of PHP as it would greatly reduce system overhead of loading and running instance of php executable for every request,
and it would reduce overhead of database connection too with this setup off course.

Only what should be known is "Basic" authentication is problematic but that can be overcomed too.

boris [d0t] manojlovic [@t] gmail [d0t] com

By: PAL

The concept is simple. You can run identical software on a computer as long as their name/IDs are unique. In the case of IP products (web servers, etc.) the additional burden is to have a unique IP/Port combination. To run PHP4 and PHP5 on the same computer just compile Apache with the prefix (e.g. --prefix=/usr/local/apache4) and the PHP5 as /usr/local/apache5) (feel free to use your own folder names). Thereafter when compiling PHP do the same. You can manually copy the PHP4 and PHP5 files to the respective modules folder. Rename each PHP CLI to php4 and php5 and copy the php4 or php5 cli to just php for programs that need a default php. You decided which is gonna be your default php. I use php4 myscript.php when I want the php4 cli. Change the listen ports to 80 and 81 (for example), respectively, if you have only one IP. If you have more than one (IP) change the Listen to each respective IPs port e.g. Listen 192.168.1.53:80 Works for me in CentOS (over a year). No guarantees. I have been developing software since 1980 :)