• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

upgrading php4 to php5

I haven't seen any issues with upgrading to PHP 5. Most applications will run in PHP5 as they did in php4. Shouldn't be any issues there...If so they should re-write the app anyway :)
 
Last edited:
The question was not issues were there, it was how do I :)

Answer: (easy option) is to use the software update function in WHM, you can then use a simple GUI to rebuild Apache, just select PHP 5 in the config page and let the backend cPanel supplied scripts build your environment for you.

Thought: If you need to ask this on a public forum, would you be better off hiring an admin to do this for you ?
 
Well, all you have to do is to go into root WHM, go to Apache Update and rebuid your apache with the php version 5 of your choice.
 
If you have shell access, you can follow this:

/scripts/easyapache --force

You will get a menu use option 7 there. You will then need to deselect the current version of php and enable the version that you require. Exit and you are done.

Before upgrading php if you have Eaccelerator installed on your server. Make sure you remove it and then install php.

Hope this helps.

Good Luck.
Lea.
 
fpshosting I recommend you dual run PHP4 and PHP5 so on signup clients have a choice of which PHP version they get to use. It will help expand your offerings.
Billy
 
if u wanna do that then you'll need summing like

PHP:
#!/bin/sh
# Abort on any errors
set -e
# Export your username before you execute this script. format
export USER="ghost"
# Update version information here.
export PHP5="php-5.1.4"
LIBICONV="libiconv-1.10"
LIBMCRYPT="libmcrypt-2.5.7"
LIBXML2="libxml2-2.6.24"
LIBXSLT="libxslt-1.1.16"
MHASH="mhash-0.9.6"
ZLIB="zlib-1.2.3"
CURL="curl-7.15.3"
LIBIDN="libidn-0.6.3"
CCLIENT="c-client"
CCLIENT_DIR="imap-2004g"
# ---- end of user-editable bits. Hopefully! ----

# Where to compile source code, will be deleted afterwards
SRCDIR="/home/${USER}/source"

# And where should it be installed?
INSTALLDIR="/home/${USER}/php5"

# Set DISTDIR to somewhere persistent, if you plan to muck around with this
# script and run it several times!
DISTDIR="/home/${USER}/dist"

#PHP Features
PHPFEATURES="--prefix=${INSTALLDIR} --with-config-file-path=${INSTALLDIR}/etc --enable-force-cgi-redirect --with-xml --with-mm --without-iconv --enable-bcmath  --enable-calendar --with-curl --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-gettext --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --with-mcrypt=${INSTALLDIR} --with-mhash --enable-magic-quotes --with-mm --with-mysqli --with-mysql=/usr --with-openssl --enable-discard-path --without-pear --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --enable-wddx --with-xmlrpc --with-zip --with-zlib "
 
# Push the install dir's bin directory into the path
export PATH=${INSTALLDIR}/bin:$PATH

#setup directories
echo 'Setting up directories.....'
mkdir -p ${SRCDIR}
mkdir -p ${INSTALLDIR}
mkdir -p ${DISTDIR}
cd ${DISTDIR}

# Get all the required packages
echo 'Downloading PHP5......'
wget -qc http://us3.php.net/distributions/${PHP5}.tar.gz
echo 'Downloading iconv......'
wget -qc http://ftp.gnu.org/pub/gnu/libiconv/${LIBICONV}.tar.gz
echo 'Downloading mcrypt......'
wget -qc http://easynews.dl.sourceforge.net/sourceforge/mcrypt/${LIBMCRYPT}.tar.gz
echo 'Downloading xml......'
wget -qc http://ftp.acc.umu.se/pub/GNOME/sources/libxml2/2.6/${LIBXML2}.tar.gz
echo 'Downlading xslt......'
wget -qc http://ftp.acc.umu.se/pub/GNOME/sources/libxslt/1.1/${LIBXSLT}.tar.gz
echo 'Downlading mhash......'
wget -qc http://easynews.dl.sourceforge.net/sourceforge/mhash/${MHASH}.tar.gz
echo 'Downloading zlib......'
wget -qc http://www.zlib.net/${ZLIB}.tar.gz
echo 'Downloading curl......'
wget -qc http://curl.haxx.se/download/${CURL}.tar.gz
echo 'Downloading idn......'
wget -qc ftp://alpha.gnu.org/pub/gnu/libidn/${LIBIDN}.tar.gz
echo 'Downloading cclient......'
wget -qc ftp://ftp.cac.washington.edu/imap/${CCLIENT}.tar.Z
echo 'Change dir to unpack'
cd ${SRCDIR}

# Unpack all the tarballs
echo 'Unpacking php5......'
tar xzf ${DISTDIR}/${PHP5}.tar.gz
echo  'Unpacking iconv......'
tar xzf ${DISTDIR}/${LIBICONV}.tar.gz
echo 'Unpacking mcrypt......'
tar xzf ${DISTDIR}/${LIBMCRYPT}.tar.gz
echo 'Unpacking xml2......'
tar xzf ${DISTDIR}/${LIBXML2}.tar.gz
echo 'Unpacking xslt......'
tar xzf ${DISTDIR}/${LIBXSLT}.tar.gz
echo 'Unpacking mhash......'
tar xzf ${DISTDIR}/${MHASH}.tar.gz
echo 'Unpacking zlib......'
tar xzf ${DISTDIR}/${ZLIB}.tar.gz
echo 'Unpacking curl......'
tar xzf ${DISTDIR}/${CURL}.tar.gz
echo 'Unpacking idn......'
tar xzf ${DISTDIR}/${LIBIDN}.tar.gz
echo 'Unpacking c-clinet......'
uncompress -cd ${DISTDIR}/${CCLIENT}.tar.Z |tar x
echo 'All unpacked......'
echo 'Lets start building......'

# The beginning of the big build
cd ${SRCDIR}/${LIBICONV}
./configure --enable-extra-encodings --prefix=${INSTALLDIR}
# make clean
make
make install
cd ${SRCDIR}/${LIBXML2}
./configure --with-iconv=${INSTALLDIR} --prefix=${INSTALLDIR}
# make clean
make
make install
cd ${SRCDIR}/${LIBXSLT}
./configure --prefix=${INSTALLDIR} \
 --with-libxml-prefix=${INSTALLDIR} \
 --with-libxml-include-prefix=${INSTALLDIR}/include/ \
 --with-libxml-libs-prefix=${INSTALLDIR}/lib/
# make clean
make
make install
cd ${SRCDIR}/${ZLIB}
./configure --shared --prefix=${INSTALLDIR}
# make clean
make
make install
cd ${SRCDIR}/${LIBMCRYPT}
./configure --disable-posix-threads --prefix=${INSTALLDIR}
# make clean
make
make install
cd  ${SRCDIR}/${LIBMCRYPT}/libltdl
./configure --prefix=${INSTALLDIR} --enable-ltdl-install
make
make install
cd ${SRCDIR}/${MHASH}
./configure --prefix=${INSTALLDIR}
# make clean
make
make install
cd ${SRCDIR}/${LIBIDN}
./configure --with-iconv-prefix=${INSTALLDIR} --prefix=${INSTALLDIR}
# make clean
make
make install
cd ${SRCDIR}/${CURL}
./configure --with-ssl=${INSTALLDIR} --with-zlib=${INSTALLDIR} \
  --with-libidn=${INSTALLDIR} --enable-ipv6 --enable-cookies \
  --enable-crypto-auth --prefix=${INSTALLDIR}
# make clean
make
make install
cd ${SRCDIR}/${CCLIENT_DIR}
make ldb
# Install targets are for wusses!
cp c-client/c-client.a ${INSTALLDIR}/lib/libc-client.a
cp c-client/*.h ${INSTALLDIR}/include
cd ${SRCDIR}/${PHP5}
./configure ${PHPFEATURES}
# make clean
make
make install

# End the big build

# Begin the big configure

#copy config file
mkdir -p ${INSTALLDIR}/etc/ ;
cp ${SRCDIR}/${PHP5}/php.ini-dist ${INSTALLDIR}/etc/php.ini

#copy PHP CGI and configure installation
echo 'Configuring the final install for the user'
mkdir -p /home/${USER}/public_html/cgi-bin
chmod 0755 /home/${USER}/public_html/cgi-bin
cp ${INSTALLDIR}/bin/php /home/${USER}/public_html/cgi-bin/php.cgi
chmod 755 /home/${USER}/public_html/cgi-bin/php.cgi
chown ${USER} /home/${USER}/public_html/cgi-bin/php.cgi
chown -R ${USER} /home/${USER}/php5/*
chgrp -R ${USER} /home/${USER}/public_html/cgi-bin/
chown -R ${USER} /home/${USER}/php5/etc
chgrp -R ${USER} /home/${USER}/php5/etc

#Make a config file
touch /home/${USER}/public_html/.htaccess
echo '#This is the bit that makes php5 work' >> /home/${USER}/public_html/.htaccess
echo 'AddHandler phpFive .php' >> /home/${USER}/public_html/.htaccess
echo 'Action phpFive /cgi-bin/php.cgi' >> /home/${USER}/public_html/.htaccess

# Install Zend Optimizer on this installation
echo 'Installing Zend Optimizer and Extension Manager'
touch /home/${USER}/php5/etc/php.ini
echo '[Zend]' >> /home/${USER}/php5/etc/php.ini
echo 'zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.0.0' >> /home/${USER}/php5/etc/php.ini
echo 'zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.0.0' >> /home/${USER}/php5/etc/php.ini
echo 'zend_optimizer.version=3.0.0' >> /home/${USER}/php5/etc/php.ini
echo 'zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so' >>/home/${USER}/php5/etc/php.ini
echo 'zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so' >>/home/${USER}/php5/etc/php.ini
echo 'Done with Zend'

# End the big configure

# Cleanup
echo 'Cleaning up'
rm -rf /home/${USER}/source
rm -rf /home/${USER}/dist

#Final notice
echo 'PHP5 is now available for this user'
echo 'The php5 binaries installed will now be used to execute all php on this users domain'

That's not php, that's a shell script, save it as whatever as chmod a+x whatever then ./whatever it, you will need root access to do this, and don't forget to set the username @ the top........
 
WHM said:
fpshosting I recommend you dual run PHP4 and PHP5 so on signup clients have a choice of which PHP version they get to use. It will help expand your offerings.
Billy

Exactly what we are doing, Put php4 with an extension of say .php4 so people can use that if neccisary.

Just makes things easier when scripts start not working.
 
Back
Top