Upgrade PHP 4 to 5 in CentOS

Question: If I want to upgrade to PHP 5.x from 4.x, what is the best source for the upgrade packages?

Here are the details for my situation:
OS: CentOS 4.5
current php package: 4.3.9-3.32.5.vm
Latest Virtualmin updates (pro version)

Here are the options I see when I do "yum list --enablerepo=centosplus | grep php":

php5.i386 5.2.4-2vm.el4 virtualmin
php.i386 5.1.6-3.el4s1.8 centosplus
(and lots of other related packages)

Any suggestions on how to do this right?

Thanks
–Ivan

NO! Don’t enable the centosplus repo. Just install our php5 packages. Please, save yourself a load of headaches!

I didn’t spend a month working on those packages, and making them work sanely along-side PHP 4 just to have folks use incompatible packages from some other source. (The centosplus php 5 packages require you to remove php 4 packages, breaking anything that relies on the older version.) ;-)<br><br>Post edited by: Joe, at: 2007/12/03 10:32

Joe, thanks for the advice so quickly, and yes I really do appreciate the work you did on this. I figured I’d give a try installing your php5 packages, and tried as follows, however there appears to be a dependency mismatch (see error at bottom):

[root@XXXXXXXX ~]# yum install php5*
Setting up Install Process
Setting up repositories
virtualmin 100% |=========================| 951 B 00:00
update 100% |=========================| 951 B 00:13
base 100% |=========================| 1.1 kB 00:00
virtualmin-universal 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for php5-ldap to pack into transaction set.
php5-ldap-5.2.4-2vm.el4.i 100% |=========================| 16 kB 00:00
—> Package php5-ldap.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5 to pack into transaction set.
php5-5.2.4-2vm.el4.i386.r 100% |=========================| 17 kB 00:00
—> Package php5.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-ncurses to pack into transaction set.
php5-ncurses-5.2.4-2vm.el 100% |=========================| 16 kB 00:00
—> Package php5-ncurses.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-pgsql to pack into transaction set.
php5-pgsql-5.2.4-2vm.el4. 100% |=========================| 16 kB 00:00
—> Package php5-pgsql.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-bcmath to pack into transaction set.
php5-bcmath-5.2.4-2vm.el4 100% |=========================| 16 kB 00:00
—> Package php5-bcmath.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-xml to pack into transaction set.
php5-xml-5.2.4-2vm.el4.i3 100% |=========================| 17 kB 00:00
—> Package php5-xml.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-cli to pack into transaction set.
php5-cli-5.2.4-2vm.el4.i3 100% |=========================| 17 kB 00:00
—> Package php5-cli.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-mcrypt to pack into transaction set.
php5-mcrypt-5.2.4-2vm.el4 100% |=========================| 16 kB 00:00
—> Package php5-mcrypt.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-pdo to pack into transaction set.
php5-pdo-5.2.4-2vm.el4.i3 100% |=========================| 16 kB 00:00
—> Package php5-pdo.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-gd to pack into transaction set.
php5-gd-5.2.4-2vm.el4.i38 100% |=========================| 16 kB 00:00
—> Package php5-gd.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-imap to pack into transaction set.
php5-imap-5.2.4-2vm.el4.i 100% |=========================| 16 kB 00:00
—> Package php5-imap.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-snmp to pack into transaction set.
php5-snmp-5.2.4-2vm.el4.i 100% |=========================| 16 kB 00:00
—> Package php5-snmp.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-mhash to pack into transaction set.
php5-mhash-5.2.4-2vm.el4. 100% |=========================| 16 kB 00:00
—> Package php5-mhash.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-mssql to pack into transaction set.
php5-mssql-5.2.4-2vm.el4. 100% |=========================| 16 kB 00:00
—> Package php5-mssql.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-devel to pack into transaction set.
php5-devel-5.2.4-2vm.el4. 100% |=========================| 46 kB 00:00
—> Package php5-devel.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-mbstring to pack into transaction set.
php5-mbstring-5.2.4-2vm.e 100% |=========================| 16 kB 00:00
—> Package php5-mbstring.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-mysql to pack into transaction set.
php5-mysql-5.2.4-2vm.el4. 100% |=========================| 17 kB 00:00
—> Package php5-mysql.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-dba to pack into transaction set.
php5-dba-5.2.4-2vm.el4.i3 100% |=========================| 16 kB 00:00
—> Package php5-dba.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-xmlrpc to pack into transaction set.
php5-xmlrpc-5.2.4-2vm.el4 100% |=========================| 16 kB 00:00
—> Package php5-xmlrpc.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-soap to pack into transaction set.
php5-soap-5.2.4-2vm.el4.i 100% |=========================| 16 kB 00:00
—> Package php5-soap.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-odbc to pack into transaction set.
php5-odbc-5.2.4-2vm.el4.i 100% |=========================| 16 kB 00:00
—> Package php5-odbc.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-common to pack into transaction set.
php5-common-5.2.4-2vm.el4 100% |=========================| 20 kB 00:00
—> Package php5-common.i386 0:5.2.4-2vm.el4 set to be updated
—> Downloading header for php5-tidy to pack into transaction set.
php5-tidy-5.2.4-2vm.el4.i 100% |=========================| 16 kB 00:00
—> Package php5-tidy.i386 0:5.2.4-2vm.el4 set to be updated
–> Running transaction check
–> Processing Dependency: libmhash.so.2 for package: php5-mhash
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-mcrypt
–> Processing Dependency: libsybdb.so.5 for package: php5-mssql
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-tidy
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-mssql
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-mhash
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Package mhash.i386 0:0.9.9-1 set to be updated
—> Package freetds.i386 0:0.64-6.el4 set to be updated
–> Running transaction check
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-mcrypt
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-tidy
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-mssql
–> Processing Dependency: php-common = 5.2.4-2vm.el4 for package: php5-mhash
–> Finished Dependency Resolution
Error: Missing Dependency: php-common = 5.2.4-2vm.el4 is needed by package php5-mcrypt
Error: Missing Dependency: php-common = 5.2.4-2vm.el4 is needed by package php5-tidy
Error: Missing Dependency: php-common = 5.2.4-2vm.el4 is needed by package php5-mssql
Error: Missing Dependency: php-common = 5.2.4-2vm.el4 is needed by package php5-mhash

Note, the error is as follows:

packages php5-mcrypt, php5-tidy, php5-mssql, and php5-mhash all have the incorrect dependency "php-common" when the dependency should be "php5-common"

Is there a way to get around this problem, or a fix scheduled?

Thanks,
Ivan

I have installed all the php5 packages which had no problems with dependencies, now another question: What’s the best way to configure Apache to use the new php5 packages rather than the old php (4) packages?

Thanks,
Ivan