I couldn't find a decent pre-existing HOWTO on upgrading from php to the php53 base packages in CentOS 5, so here's an attempt. You may want to start with a
yum clean all to clear any cached data. These commands need to be run as root.
First, run
yum list installed 'php*' to see what packages you're currently using. You'll get something like this:
Code:
php.i386 5.1.6-39.el5_8 installed
php-cli.i386 5.1.6-39.el5_8 installed
php-common.i386 5.1.6-39.el5_8 installed
php-gd.i386 5.1.6-39.el5_8 installed
php-mysql.i386 5.1.6-39.el5_8 installed
php-pdo.i386 5.1.6-39.el5_8 installed
php-xml.i386 5.1.6-39.el5_8 installed
Then find out what PHP 5.3 packages and modules are available with
yum list available 'php53*':
Code:
php53.i386 5.3.3-13.el5_9.1 updates
php53-bcmath.i386 5.3.3-13.el5_9.1 updates
php53-cli.i386 5.3.3-13.el5_9.1 updates
php53-common.i386 5.3.3-13.el5_9.1 updates
php53-dba.i386 5.3.3-13.el5_9.1 updates
php53-devel.i386 5.3.3-13.el5_9.1 updates
php53-gd.i386 5.3.3-13.el5_9.1 updates
php53-imap.i386 5.3.3-13.el5_9.1 updates
php53-intl.i386 5.3.3-13.el5_9.1 updates
php53-ldap.i386 5.3.3-13.el5_9.1 updates
php53-mbstring.i386 5.3.3-13.el5_9.1 updates
php53-mysql.i386 5.3.3-13.el5_9.1 updates
php53-odbc64.i386 5.3.3-2.el5 base
php53-odbc.i386 5.3.3-13.el5_9.1 updates
php53-pdo.i386 5.3.3-13.el5_9.1 updates
php53-pgsql.i386 5.3.3-13.el5_9.1 updates
php53-process.i386 5.3.3-13.el5_9.1 updates
php53-pspell.i386 5.3.3-13.el5_9.1 updates
php53-snmp.i386 5.3.3-13.el5_9.1 updates
php53-soap.i386 5.3.3-13.el5_9.1 updates
php53-xml.i386 5.3.3-13.el5_9.1 updates
php53-xmlrpc.i386 5.3.3-13.el5_9.1 updates
If there is a corresponding php53 package for each php one you have installed, you're good. Otherwise, you may have to use other repositories to get the missing packages, or you may not actually need those modules at all. We'll assume that everything you need is there, as in this example. You will want to stop your web server using
service httpd stop (for Apache).
Now you will remove the packages with
yum remove php php-cli php-common php-gd php-mysql php-pdo php-xml, using the names of the packages from the first step. Yum may want to remove other packages that depend on these.
Make sure you note all the names of these packages.Then you can install the 5.3 packages using
yum install php53 php53-cli php53-common php53-gd php53-mysql php53-pdo php53-xml. Also include the names of any other packages that were removed in the previous step. If yum complains that some dependencies can't be resolved, then one or more of those additional packages are marked as requiring PHP 5.1. You can revert back to your original setup by running something like
yum install php php-cli php-common php-gd php-mysql php-pdo php-xml, including the names of any additional packages removed in the prior step.
If the php53 install succeeded, then you can restart the web server with
service httpd start, although it might be a good idea to just reboot the entire server to make sure everything's working. Then you can try visiting your web applications to make sure they behave as expected. That's about it.