Updating PHP for Wordpress 3.2, Joomla 1.6 and others

The newest version of WordPress (3.2) and Joomla (1.6.4) requires at least PHP 5.2.4 for it to work properly. If you are using Centos (or Redhat), the default version of PHP is going to be 5.1.6.

Luckly, they also ship with PHP 5.3, so you can install it in order to use the latest versions of WordPress or Joomla.

Removing old PHP version.

You can not have both versions of PHP installed on CentOS/Redhat or you will get some conflicts:

php53-common-5.3.3-1.el5_6.1.i386 from updates has depsolving problems

So you first need to remove the old versions of PHP from there. The following command will do it:

# yum remove php php-*
Removed:
php.i386 0:5.1.6-27.el5_5.3 php-cli.i386 0:5.1.6-27.el5_5.3 php-common.i386 0:5.1.6-27.el5_5.3 php-mysql.i386 0:5.1.6-27.el5_5.3 php-pdo.i386 0:5.1.6-27.el5_5.3

Complete!

Installing new version (PHP 5.3)

Once you finish removing the old version of PHP, the following command will install the new one:

# yum install php53.i386 php53-cli.i386 php53-common.i386 php53-mysql.i386 php53-gd.i386
Installed:
php53.i386 0:5.3.3-1.el5_6.1 php53-cli.i386 0:5.3.3-1.el5_6.1 php53-common.i386 0:5.3.3-1.el5_6.1 php53-gd.i386 0:5.3.3-1.el5_6.1 php53-mysql.i386 0:5.3.3-1.el5_6.1

Complete!

After that, just restart Apache ( /etc/init.d/httpd restart ) and you are set to update WordPress! You can check the new version by running (php -v):
# php -v
PHP 5.3.3 (cli) (built: Mar 30 2011 13:51:41)

That's it! If you have any question, let us know.

Home | Login or Signup