Technology Blog

Installing php52 on centos 6

by on Nov.19, 2012, under Uncategorized

So, for some reason you need to install php 5.2 on centos6 (Ok Register Globals – because your client won’t pay for updating the software – right?)   So Here you go:     – Enable Atomicorp repo Run following command to enable Atomic YUM repo:

wget -q -O - | sh

– Disable PHP 5.3 Atomic repo contains both PHP 5.2 and 5.3. Official RHEL/CentOS 6 repo also contains PHP 5.3. To disable PHP 5.3, add following line to YUM configuration file /etc/yum.conf:


– Install PHP packages Use following commands to install PHP 5.2 packages:
arch=$(uname -m)

yum install yum install php.$arch php-bcmath.$arch php-cli.$arch php-common.$arch php-dba.$arch php-devel.$arch php-embedded.$arch php-fpm.$arch php-gd.$arch php-imap.$arch php-intl.$arch php-ioncube-loader.$arch php-ldap.$arch php-mbstring.$arch php-mcrypt.$arch php-mhash.$arch php-mysql.$arch php-ncurses.$arch php-odbc.$arch php-pdo.$arch php-pear.$arch php-pecl.$arch php-pgsql.$arch php-process.$arch php-rspell.$arch php-recode.$arch php-snmp.$arch php-soap.$arch php-tidy.$arch php-xml.$arch php-xmlrpc.$arch php-zts.$arch php-sqlite.$arch -y

Here, machine architecture (e.g. x86_64 for Intel 64-bit architecture) is stored in the variable arch and its value is appended to each PHP package to avoid installing same package from multiple architectures. The list of PHP packages to be installed may vary depending on your requirements. If you do not know the correct name for a PHP package, search for PHP packages with following command:

yum search php

This command will list RPM packages having the string ‘php’ in their name along with a short description for each package.

Be Sociable, Share!

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...