Update PHP 5.16 to 5.2.13 on CentOS

To get the new version of vBulletin (4.0) running, I needed to update my PHP version to 5.2.0 or greater. I have a rough understanding of the linux filesystem and using the command line, but if you have no experience it might be worth getting a pro to make these updates for you.

The latest version of PHP that CentOS 'officially' supports is 5.1.6, so to get the later version of PHP running you will need to tell it where to look (step 1). This probably isn't recommended by CentOS, but this version of PHP has been out for years so you can assume it is safe to use unless you are running something mission critical!

I have never had to update PHP but these are the simple steps I followed which worked flawlessly for me:

  1. Log in to your server via SSH (you will need to be a user with root privileges)

  2. wget -q -O - http://www.atomicorp.com/installers/atomic |sh

  3. Enter y (yes) when prompted. My required updates were about 5MB.

  4. Then update PHP with yum: yum update php

  5. I restarted Apache via: /usr/sbin/apachectl graceful (I assume this is necessary?)

  6. And check the version of PHP via: php -v and thankfully it said 5.2.13! Now to try installing vBulletin 4.0…