This script allow you to install php5 along with php4 on a Cpanel server with Choon’s annonymous spamer patch.
To run php 5 scripts, you have to name the file with .php5 extension.
http://devel.webonce.com/php5.txt
#!/bin/sh
# Copyright 2005 (c) Jacob Mather / WebOnce Technologies
# [email protected]
# All Rights ReservedVERSION=5.0.5
cd /usr/src
wget -O php.tbz2 “http://us3.php.net/get/php-${VERSION}.tar.bz2/from/this/mirror”
tar -xjvf php.tbz2
rm -f php.tbz2wget http://choon.net/opensource/php/php-${VERSION}-mail-header.patch
cd php-${VERSION}
patch -p1 } –prefix=/usr/local/php5 –exec-prefix=/usr/local/php5 –enable-force-cgi-redirect –enable-discard-path”
./configure $CFGLINE
make
make installif [ -f /usr/local/php5/bin/php ]
then
#cp -f php.ini-recommended /usr/local/php5/lib/php.inicp /usr/local/php5/bin/php /usr/local/cpanel/cgi-sys/php5
chown root:wheel /usr/local/cpanel/cgi-sys/php5echo “Action application/x-httpd-php5 “/cgi-sys/php5″” > /usr/local/apache/conf/php5.conf
echo “AddType application/x-httpd-php5 .php5” >> /usr/local/apache/conf/php5.confTEST=`grep php5.conf /usr/local/apache/conf/httpd.conf`
if [ “$TEST” = “” ]
then
echo “Include /usr/local/apache/conf/php5.conf” >> /usr/local/apache/conf/httpd.conf
/etc/init.d/httpd restart
fi
else
echo “There was an error…”
fi