HostOnNet Blog

Installing php5 with existing php4

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
# jmather@webonce.com
# All Rights Reserved

VERSION=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.tbz2

wget 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 install

if [ -f /usr/local/php5/bin/php ]
then
#cp -f php.ini-recommended /usr/local/php5/lib/php.ini

cp /usr/local/php5/bin/php /usr/local/cpanel/cgi-sys/php5
chown root:wheel /usr/local/cpanel/cgi-sys/php5

echo “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.conf

TEST=`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


Posted in Cpanel Server. Bookmark the permalink.