Linux Stuff && Coffee

PHP 5.3 CentOS 6 Install / Upgrade

| Comments

This guide shows you how to install PHP 5.3 on CentOS if you already have PHP 5.1 installed on then you need to remove it before install installing php53 via YUM.

To list all PHP RPM’s (packages) on CentOS use:

rpm -qa | grep php

This should list all RPM’s containing the text php on your system (so you know what packages to remove).

Remove the existing PHP RPM’s, now this is going to vary from install to install, however the following remove command should remove all PHP packages from most CentOS installs.

yum remove php php-cli php-common php-gd php-imap php-intl php-mbstring php-mysql php-odbc php-pdo php-pspell php-snmp php-xml php-xmlrpc

Then install PHP 5.3 with:

 yum install php53 php53-cli php53-common php53-gd php53-imap php53-intl php53-mbstring php53-mysql php53-odbc php53-pdo php53-pspell php53-snmp php53-xml php53-xmlrpc

You will need to restart Apache for it to use php 5.3.