Installing Php 5.2 on CentOS/Redhat

When it comes to php installation, most of us will use simple yum utility in CentOS or RedHat Linux. But when you would try to install php using yum, you will notice that it will install latest version of php (5.3 or later) binaries.

But most of the time it has happened that Development team has asked me to install older release of php(php v. 5.2). I have spent so much time in downgrade process of php version, but finally I have figured out how to install older release in few minutes. So below process would help you to install php 5.2 in latest release of CentOS.

So before we start, lets first remove all php packages using below command. You may need to run below command 2-3 times to remove all php packages.

Once you run above command, you can check with "rpm -qa | grep php" command if still there is any php package is installed.

Now we need to get webtatic repository and install it. You can use below command to download and install webtatic repository.


Once you are done with installation, you need to fire below command to install php 5.2 in Centos.


Of course you can edit above command to install your desired php library files.

Hope this post would be helpful who wants to install php 5.2 in CentOS.

No comments:

Post a Comment