Install PHP 5.4, PHP 5.5 or PHP 5.6 on CentOS 6.X

Step 1: Install EPEL and Remi Repository

 

# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm remi-release-6.rpm

 

Step 2: Install Yum-Utils to Manage Repository

# yum install yum-utils

 

Step 3: Install PHP 5.4, PHP 5.5 or PHP 5.6 on CentOS 6

# yum-config-manager –enable remi-php54 [Intall PHP 5.4]

# yum-config-manager –enable remi-php55 [Intall PHP 5.5]

# yum-config-manager –enable remi-php56 [Intall PHP 5.6]

Step 4: Install PHP versions

Once you’ve enabled selected version of PHP, you can install PHP (in my case I have chosen PHP 5.6) with all needed modules as shown.

# yum-config-manager –enable remi-php56 [Intall PHP 5.6]

# yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo