| Howto upgrade php4 to php5 ? This Tutorial is for Plesk 7.5 and Fedora Core 2, upgrade on other Fedora Core/RedHat/CentOS is very similar Notes on Apache Plesk implements two completely seperate instances of Apache. There is "httpd" that serves your virtual hosts and "httpsd" that serves the Plesk control panel itself. During this procedure, We're not going to touch "httpsd" and we're only going to update two config files for "httpd". The PHP5 SAPI apache2handler module needs to be compiled into PHP using the --with-apxs2 directive, however the version of apxs that exists as standard in the Plesk file system at "/usr/local/psa/admin/bin/apxs" is a customised version, designed for use with "httpsd" and you *cannot* use it for compiling your new PHP5. You must obtain a correct version of apxs, as described below. Upgrade Procedure Make yourself comfortable and open your Shell, we shall begin. Install Yum Code: # cd /tmp # wget ftp://fr2.rpmfind.net/linux/fedora/core/2/i386/os/Fedora/RPMS/yum-2.0.7-1.1.noarch.rpm # rpm -iv yum-2.0.7-1.1.noarch.rpm Maybe you will need to insall some dependencies Get the "apxs" script with required libraries and headers Installing the "httpd-devel" package will sort this out for us. Code: # yum install http-devel "apxs" will be installed in /usr/sbin as part of the package install. Don't worry about configuring "apxs" to compensate for the non-standard Apache installation path, the yum install of "httpd-devel" will pick it up and sort it out for us. Get all the other packages needed to compile PHP5 Install all of the following and any dependencies that crop up. You can use "yum" (if you like an easy life) but do them one at a time. Code: # yum install libxml2-devel
# yum install openssl-devel
# yum install BZip2-devel
# yum install curl-devel
# yum install libjpeg-devel
# yum install libpng-devel
# yum install gmp-devel
# yum install libc-client-devel
# yum install mysql-devel
# yum install ncurses-devel
# yum install unixODBC-devel
# yum install postgresql-devel
# yum install aspell-devel These three packages are required to fix a dependency bug in the FC2 version of "net-snmp-devel" and must be installed first. Code: # yum install rpm-devel
# yum install elfutils-devel
# yum install beecrypt-devel Now the last one Code: # yum install net-snmp-devel IMPORTANT - Install UW-IMAP c-client **This is essential for Horde** Get and install this package: Code: # wget ftp://fr2.rpmfind.net/linux/fedora/core/2/i386/os/Fedora/RPMS/libc-client-devel-2002e-5.i386.rpm It isn't available via "yum" so you'll need to download and install it using "rpm". Code: # cd /tmp # wget ftp://fr2.rpmfind.net/linux/fedora/core/2/i386/os/Fedora/RPMS/libc-client-devel-2002e-5.i386.rpm # rpm -iv libc-client-devel-2002e-5.i386.rpm Compiling PHP - The good bit Now that you have everything in place, you can configure, compile and install PHP5. The ./configure directives below are absolutely critical if you're going to end up with a working system after this procedure. Ensure that you copy them carefully. You can add anything else that you need but these are the absolute minimum set of directives needed, especially to maintain Horde functionality. Configure If you haven't got it already, download the PHP-5.x.x source distribution from http://www.php.net to a suitable location and expand it. I used /usr/local/src/php5, you can use whatever you want as long as you remember where it is! Code: # cd to your expanded PHP-5.x.x source directory # rm -f config.cache # make clean Now run the ./configure command as stated below. Do not remove or change anything in this example unless you know what you're doing. Code: './configure' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4' '--with-curl' '--with-exec-dir=/usr/bin' '--with-ttf' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-dom=/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=/usr/lib' '--with-imap-ssl' '--with-kerberos' '--with-ldap' '--with-mysql' '--enable-xslt' '--with-xslt-sablot' '--with-sablot-js=/usr' '--with-pgsql' '--with-snmp=/usr' '--enable-ucd-snmp-hack' '--with-unixODBC=/usr' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs2=/usr/sbin/apxs' All being well, ./configure should have completed with no errors so you can now compile. If PHP compiled with no errors, you can install it. Code: # make install # ./libtool --finish /usr/local/src/php5/php-5.0.1/libs PHP Run-time Config (php.ini) You do not need to add the path to PEAR as suggested by # make install. The path is added to the PHP run-time configuration dynamically by Horde. You can add it if you intend to develop using PEAR at some point in the future. My php.ini worked without any changes, however you may wish to adjust it to your own requirements. I would finish this procedure first though in order to ensure that you have a working system before doing anything else. Apache Run-time Config (httpd.conf) You only need to make two small changes. I'm using "vi" to edit the config files. You can use the editor of your choice. Code: # vi /etc/httpd/conf.d Change the top line of "conf.d" so that it loads the new PHP5 module instead of the old PHP4 module i.e. "LoadModule php5_module modules/libphp5.so" Code: # vi /etc/httpd/conf/httpd.conf At the foot of the file, comment out the line that reads "LoadModule php5_module /usr/lib/httpd/modules/libphp5.so". This was added by the PHP5 install but it's not needed as it's already in "conf.d". Zend Zend was updated to version 2 during the PHP5 install. I didn't need to make any further changes. Ioncube Contrary to many reports that I've read, nothing has needed to changed here. Pear The PHP5 install upgrades a couple of PEAR packages automatically. Nothing else needed to be done. Archive_Tar - upgraded to v1.3.1 XML_RPC - upgraded to v1.4.6 Finally Restart Apache and you should have a new working PHP5 system. |