Nicholas Skinner

Freelance website and web application developer

Archive for August, 2011

Installing PHP 5.3 on CentOS 5.6

Thursday, August 18th, 2011

yum PHP 5.3 ScreenshotAfter WordPress recently dropped support for PHP versions <5.2 I decided it was time to look into updating my install of PHP 5.1.6 to something more current. I was somewhat hoping the update would just appear on yum and happen automatically however looking into it I realise this was unlikely to happen: Quote: “As with each other program in CentOS, the version numbers of released software will not change over the life time of a CentOS product.” — http://wiki.centos.org/FAQ/CentOS5

After Googling for a few options and not coming up with any I was particularly happy with (i.e. mostly using 3rd party repositories) I happened to run “yum list|grep php” and noticed a set of “php53*” packages. Appears it was decided at some point to make both versions of PHP available such that the user can choose which to install, but old installs would not be updated automatically to (most likely) limit the possibility of issues caused by incompatibilities.

I therefore ran the below commands and was upgraded to PHP 5.3 much quicker and with a lot less complication than I was expecting:

service httpd stop

yum remove php php-*

yum install php53
#yum install php53-cli #via dependency
#yum install php53-common #via dependency
yum install php53-gd
yum install php53-imap
yum install php53-mbstring
yum install php53-mysql
#yum install php53-pdo #via dependency
yum install php53-soap
yum install php53-xml

service httpd start