I've done it just today. I had a stable debian sarge system, running apache2, mysql-4.1, and php4 (all the modules installed in "the perfect setup").
I've decided to let php4 run like apache2 module, as it is in "the perfect setup", and I just wanted to add php5 as a cgi.
I just ran:
apt-get install php5-cgi
Then I had to edit my "httpd.conf" file, or better to say one virtaul host's directives. A added a line in one of the <VirutalHost...> entries:
AddHandler php-scriptt .php
Action php-scriptt /cgi-bin/php5
Notice the 2 tt
's in the config file!!! I had to do it this way cause otherwise php4 always parsed the file in that directory, even when I tried to use .php5 extension.
I also added "Options +ExecCGI" to that directory, just in case, not shure if it's really needed.
This works like a charm, a can set php4/php5 on "per virtualhost" bases, or even per directory if I want to. Also, I don't need to change extension and do a search&replace on every skript that needs to be in PHP5. Not to mention the trouble you have to go, upgradeing one og these scripts...
It's kinda late now, have to catch some sleep
I just need to install a cople more things, I want to install
apt-get install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-ming php5-mysql php5-mysqli php5-odbc php5-pdo-mysql php5-pdo-sqlite php5-pear php5-pspell php5-snmp php5-sybase php5-tidy
(I'm not touching any php4 modules)
but I get a warning
The following packages will be REMOVED:
Hm, what to do?
I would really like to leave pear repository for php4...