PHP 5.2 on CentOS 6

I’m currently using Virtualmin on CentOS 6 with PHP version 5.3.3 (the default version). While some websites on that server require PHP 5.3 (and thus run fine), I would like to host some legacy websites as well. These sites require PHP 5.2 or lower to run. I have seen documentation on how to install PHP 5.4 alongside the default PHP version (, but this trick doesn’t seem to work for PHP 5.2. Is there a way to install PHP 5.2 and add it on to Virtualmin? And if not, is it possible by compiling PHP 5.2 from source and using tools like fastCGI (guide or link to a guide would be very much appreciated)?


Unfortunately, as you’re seeing, the software collections repository only contains PHP 5.4, it doesn’t contain 5.2.

You could install it by compiling it manually, if you wanted, though that can be a bit tricky and there unfortunately isn’t a guide for that.

The key though is that you’d want to use similar paths for the various PHP files as the software collections version of PHP 5.4 uses.


for 5.,2