I am migrating a customers many websites to a new Centos 7 server so we can use PHP 7.
Unfortunately there are a couple of old systems that are not working on PHP 5.4 or above, and its not feasible to upgrade them. I have tried fixing their code, but cant get it working, seems like it would take too long, its not within the scope of the project as we are only moving sites.
So is there a way to put PHP 5.3 on Centos 7 as an additional PHP version, like I have done with PHP 7, so I can get these old systems working? I cant find resources about it online.
While it is possible to use multiple PHP versions on CentOS, there unfortunately aren’t any supported ways to add PHP 5.3, as it reached it’s end of life back in 2014.
For more recent PHP versions, those can be installed from the CentOS SCL repo, but there isn’t any such version of 5.3.
My recommendation would be to not attempt to install PHP 5.3, due to the security issues of using unsupported software. You might even consider leaving them on the old server until they’re able to migrate to a different website.
However, if you really wanted to use PHP 5.3 anyhow, you might consider looking into either compiling it yourself, or, there may be unsupported packages out there that you could temporarily use.
Sorry, I wish I had an awesomer answer!
Thanks Eric. I was worried this was the case… BUT my issue still has hope yet.
I actually notice that although PHP 5.4 is chosen for the site, and it should work with that as another site on the server using the same system works OK, it is in fact using PHP 7. phpinfo shows PHP7 being used, NOT PHP 5.4 which is selected in Virtualmin. I have changed it to PHP 7 then back again to PHP 5.4 but still shows PHP 7.
So I am looking into this, and if I can figure it out will raise another ticket, because this is the actual issue, and I should not need PHP 5.3.3.
I have fixed it all. PHP 5.3.3. was a red herring and not needed.
Further investigation show the site was using PHP 7 even though it was set to PHP 5.4
Upon restarting Apache, it would not restart, and I got an error about SSL certs being empty or missing. So the SSL files were indeed 0Kb in size.
The site was copied from another server using Cloudmin, so it seems the SSL did not copy for some reason.
The empty SSL weirdly results in PHP 7 being used. As soon as I copied the original SSL from the old server, Apache restarted OK, and PHP 5.4 was being used and the site works.
So all a bit strange to me.
That is indeed all very odd, but I’m glad you got it working, thanks for letting us know!