How to install php 5 mode cgi on apache 1.3 with mod php 4 / Debian stable
php4 and php5 on same server is not that complex
You must be root (or able to sudo)!
1. check that cgi-bin mod_alias is activated
in /etc/apache/httpd.conf search for:
<IfModule mod_alias.c>
#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
...
the line should be uncommented
2. Install php5-cgi
update:
apt-get update
simulate install:
apt-get -s install php5-cgi
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed
php5-cgi
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
...
if you have something similar, let’s do it for real
apt-get install php5-cgi
3. add an handler in the directory where php5 files are
in the directory where you want to have php5 running (ex: /var/www/myphp5site/)
create an .htaccess file containing:
AddHandler x-httpd-php5 .php
Action x-httpd-php5 /cgi-bin/php5
4. gracefuly restart apache
apachectl graceful
It’s done, enjoy.
sources:


