Updating WordPress: Upgrading php53 on CentOS
If you have a self-hosted WordPress blog, you really ought to keep it up to date. Popular software is a popular security target, and as new exploits are discovered, new patches are deployed. Fortunately, WordPress makes this super-easy. Just go to Dashboard > Updates and you can update with one click. I basically get a free update any time I get it in my head to write something.
Except this morning, when I was told that an update was available, but:
On my CentOS VM, this was addressed by:
sudo yum update sudo service httpd restart
Actually, it was a little difficult, because we’re replacing php with php53:
0-13:11 djh@www0 ~$ cat /etc/redhat-release
CentOS release 5.6 (Final)
0-13:11 djh@www0 ~$ rpm -q php
php-5.1.6-27.el5_5.3
0-13:11 djh@www0 ~$ yum list installed | grep ^php
php.x86_64 5.1.6-27.el5_5.3 installed
php-cli.x86_64 5.1.6-27.el5_5.3 installed
php-common.x86_64 5.1.6-27.el5_5.3 installed
php-gd.x86_64 5.1.6-27.el5_5.3 installed
php-mysql.x86_64 5.1.6-27.el5_5.3 installed
php-pdo.x86_64 5.1.6-27.el5_5.3 installed
1-13:11 djh@www0 ~$ sudo service httpd stop
Stopping httpd: [ OK ]
0-13:11 djh@www0 ~$ yum list installed | grep ^php | awk '{print $1}'
php.x86_64
php-cli.x86_64
php-common.x86_64
php-gd.x86_64
php-mysql.x86_64
php-pdo.x86_64
0-13:12 djh@www0 ~$ sudo yum remove `!!`
sudo yum remove `yum list installed | grep ^php | awk '{print $1}'`
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.1.6-27.el5_5.3 set to be erased
---> Package php-cli.x86_64 0:5.1.6-27.el5_5.3 set to be erased
---> Package php-common.x86_64 0:5.1.6-27.el5_5.3 set to be erased
---> Package php-gd.x86_64 0:5.1.6-27.el5_5.3 set to be erased
---> Package php-mysql.x86_64 0:5.1.6-27.el5_5.3 set to be erased
---> Package php-pdo.x86_64 0:5.1.6-27.el5_5.3 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
php x86_64 5.1.6-27.el5_5.3 installed 6.2 M
php-cli x86_64 5.1.6-27.el5_5.3 installed 5.3 M
php-common x86_64 5.1.6-27.el5_5.3 installed 397 k
php-gd x86_64 5.1.6-27.el5_5.3 installed 333 k
php-mysql x86_64 5.1.6-27.el5_5.3 installed 196 k
php-pdo x86_64 5.1.6-27.el5_5.3 installed 114 k
Transaction Summary
================================================================================
Remove 6 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : php-gd 1/6
Erasing : php 2/6
Erasing : php-mysql 3/6
Erasing : php-cli 4/6
Erasing : php-common 5/6
warning: /etc/php.ini saved as /etc/php.ini.rpmsave
Erasing : php-pdo 6/6
Removed:
php.x86_64 0:5.1.6-27.el5_5.3 php-cli.x86_64 0:5.1.6-27.el5_5.3
php-common.x86_64 0:5.1.6-27.el5_5.3 php-gd.x86_64 0:5.1.6-27.el5_5.3
php-mysql.x86_64 0:5.1.6-27.el5_5.3 php-pdo.x86_64 0:5.1.6-27.el5_5.3
Complete!
0-13:13 djh@www0 ~$ sudo yum install php53 php53-mysql php53-gd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: yum.singlehop.com
* epel: mirror.steadfast.net
* extras: mirror.fdcservers.net
* updates: mirror.sanctuaryhost.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php53.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Processing Dependency: php53-cli = 5.3.3-1.el5_6.1 for package: php53
--> Processing Dependency: php53-common = 5.3.3-1.el5_6.1 for package: php53
---> Package php53-gd.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Processing Dependency: libXpm.so.4()(64bit) for package: php53-gd
---> Package php53-mysql.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Processing Dependency: php53-pdo for package: php53-mysql
--> Running transaction check
---> Package libXpm.x86_64 0:3.5.5-3 set to be updated
---> Package php53-cli.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-common.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-pdo.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php53 x86_64 5.3.3-1.el5_6.1 updates 1.3 M
php53-gd x86_64 5.3.3-1.el5_6.1 updates 109 k
php53-mysql x86_64 5.3.3-1.el5_6.1 updates 92 k
Installing for dependencies:
libXpm x86_64 3.5.5-3 base 44 k
php53-cli x86_64 5.3.3-1.el5_6.1 updates 2.4 M
php53-common x86_64 5.3.3-1.el5_6.1 updates 605 k
php53-pdo x86_64 5.3.3-1.el5_6.1 updates 67 k
Transaction Summary
================================================================================
Install 7 Package(s)
Upgrade 0 Package(s)
Total download size: 4.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): libXpm-3.5.5-3.x86_64.rpm | 44 kB 00:00
(2/7): php53-pdo-5.3.3-1.el5_6.1.x86_64.rpm | 67 kB 00:00
(3/7): php53-mysql-5.3.3-1.el5_6.1.x86_64.rpm | 92 kB 00:00
(4/7): php53-gd-5.3.3-1.el5_6.1.x86_64.rpm | 109 kB 00:00
(5/7): php53-common-5.3.3-1.el5_6.1.x86_64.rpm | 605 kB 00:00
(6/7): php53-5.3.3-1.el5_6.1.x86_64.rpm | 1.3 MB 00:00
(7/7): php53-cli-5.3.3-1.el5_6.1.x86_64.rpm | 2.4 MB 00:00
--------------------------------------------------------------------------------
Total 12 MB/s | 4.6 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php53-common 1/7
Installing : php53-pdo 2/7
Installing : php53-cli 3/7
Installing : libXpm 4/7
Installing : php53 5/7
Installing : php53-mysql 6/7
Installing : php53-gd 7/7
Installed:
php53.x86_64 0:5.3.3-1.el5_6.1 php53-gd.x86_64 0:5.3.3-1.el5_6.1
php53-mysql.x86_64 0:5.3.3-1.el5_6.1
Dependency Installed:
libXpm.x86_64 0:3.5.5-3 php53-cli.x86_64 0:5.3.3-1.el5_6.1
php53-common.x86_64 0:5.3.3-1.el5_6.1 php53-pdo.x86_64 0:5.3.3-1.el5_6.1
Complete!
0-13:14 djh@www0 ~$ sudo service httpd start
Starting httpd: [ OK ]
And now I have successfully upgraded via the web UI.
Most days, I am not a CentOS admin, so if there is a better way to have done this, I am keen to hear.

Responses
Upgrade to PHP53 on CentOS – Life is better above 10,000 feet
[…] updated. Well it turns out to be slightly more complicated than “yum update all”. Instructions to easily upgrade PHP to version 5.3.x on your CentOS server to allow WordPress 3.2 to install […]
Elatllat
service httpd stop;yum remove -y php-common;yum install -y php53-mysql;service httpd start;
Daniel Howard
Short and sweet! Â Thanks. Â -danny
Casey Bergman
Thanks for the working protocol. I had a conflict with one of my plugins (slide2comment), that I had to disable before running the upgrade. Â
Sproket90
No package php53-mysql available.  :(
Sproket90
nevermind, my yum was broken
Sproket90
ok php installed, now wordpress is broke… why does linux have to be so hard… ? :(
it’s like it does not know what to do with php files…
Darrion1982
Thanks, this was just what I needed!
Comment
Tiny Print:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>