If you’re here then you probably already know how to install PHP 5.2 on your CentOS 5.2. One of the ways would be to use a third-party repository like Remi. Here is a good article on how to use it.
If after trying to use a third-party repository to install PHP 5.2 you get a “Could not find update match for php” error then there is a big chance you have a priorities package installed in your CentOS distribution and some repos are not properly configured priorities wise: basically your third-party repo does not have a chance to look for PHP 5.2 binaries because other (default CentOS) repositories get priority.
The easiest way to fix the problem is to temporarily disable the priorities package.
Edit the priorities file:
sudo vi /etc/yum/pluginconf.d/priorities.conf
and set “enabled” equal to 0
To check if the priorities package is installed on your system run:
rpm -q yum-priorities