I need to upgrade PHP to 5.2.x
Im referring here as how to do upgrade it:
But that was testing repository. Is it safe to use it on live server?
The answer is on the CentOS site
So that's that.
However due to the age of PHP 5.1.6 and the expectations of customers I can see why you may want to do the upgrade anyway.
From my experience I have a server running 5.2.10 from the testing repository. There have been no problems in using this version from Testing.
Obviously I cannot provide any assurance it won't break on your setup but you can reduce any disruption by enabling rollbacks in Yum. To do this add
Then if anything breaks you can rollback. There is an example of how to do this here.
So the steps involved are:
The Testing Repository should be left disabled, by setting
This means you will have to manually check for updates to PHP regularly by using
The bottom line is that it appears to work okay, but if you break anything you get to keep the pieces so you best have backups.
Jason Litka provides 3rd-party RPMs for php: http://www.jasonlitka.com/yum-repository/
Safety is always a sliding scale. Clearly you are already running Centos, meaning you are probably running without a support contract of any kind and you have deemed this to be safe. I'm going to assume that when you hit problems you either try and debug yourself or you ask the community for assistance, and go from there. This is already "unsafe" from a bank/large corporation perspective.
Sticking with either the Centos testing RPMs or Jason Litka's will place you more at risk of problems but there are still a significant portion of the user-base who are running this way. A newer version of PHP may have more security bugs, while it may contain some fixes. Redhat/Centos are sometimes lax in backporting fixes properly (which was why they got hacked - they didn't backport a kernel fix not marked as a security risk).
Going down the Centos testing path may require you to upgrade glibc, which could then mean you have to start upgrading other packages you never intended to touch. For this reason I would recommend Jason's repository.
Please make sure all additional repositories remained disabled (enabled=0) and you explicitly enable them on the yum command-line or using your configuration management tool
yum --enablerepo=jason install php
Maybe check the atomic turtle repository. They wrote plesk and these days focus on atomic secured Linux. Recent PHP rpms are available on their site and updated regularily.