Pour info, voici ce que j’ai fait sur un de mes serveurs sous Debian Etch pour l’installer (PHP 4 et non 5) en parallèle d’ISPConfig :
(C’est un extrait de mes notes ... pas du grand art !)
sd04 :/tmp# a2dismod php4
sd04 :/tmp# apt-get install apache2-prefork-dev
sd04 :/tmp# apt-get install php4-cgi
sd04 :/tmp# wget http://www.suphp.org/download/suphp-0.6.3.tar.gz
sd04 :/tmp# tar xvfz suphp-0.6.3.tar.gz
sd04 :/tmp# cd suphp-0.6.3
sd04 :/tmp/suphp-0.6.3#
Dans le fichier source src/apache2/mod_suphp.c, remplacer les lignes 324 & 325 comme suit :
AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"),
AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"),
Ensuite, on lance la compilation et l’installation comme suit :
sd04 :/tmp/suphp-0.6.3# ./configure —prefix=/usr —sysconfdir=/etc —with-apache-user=www-data —with-setid-mode=paranoid —with-apxs=/usr/bin/apxs2
sd04 :/tmp/suphp-0.6.3# make
sd04 :/tmp/suphp-0.6.3# make install
On copie alors le fichier "suphp.conf" dans /etc, après avoir fait une copie de l’ancien, au cas où :
sd04 :/tmp/suphp-0.6.3# mv /etc/suphp.conf /etc/suphp.conf.old
sd04 :/tmp/suphp-0.6.3# cp /tmp/suphp-0.6.3/doc/suphp.conf-example /etc/suphp.conf
Ensuite, on édite le suphp.conf afin que son contenu soit rigoureusement ce qui suit :
[global]
;Path to logfile
logfile=/var/log/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=www-data
;Path all scripts have to be in
docroot=/
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=true
;Send minor error messages to browser
errors_to_browser=false
;PATH environment variable
env_path=/bin :/usr/bin
;Umask to set, specify in octal notation
umask=0077
; Minimum UID
min_uid=100
; Minimum GID
min_gid=100
[handlers]
;Handler for php-scripts
x-httpd-php=php :/usr/bin/php4-cgi
;Handler for CGI-scripts
x-suphp-cgi=execute : !self
On ajoute alors le chargement du module "mod_suphp" dans le fichier de conf d’Apache2 :
sd04 :/tmp/suphp-0.6.3# pico /etc/apache2/httpd.conf
LoadModule suphp_module /usr/lib/apache2/modules/mod_suphp.so
On relance Apache2 :
sd04 :/tmp/suphp-0.6.3# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)... waiting .
sd04 :/tmp/suphp-0.6.3#