Installing / Updating PHP to PHP 5.4 PHP 5.5 or PHP 5.6 on Webmin / Virtualmin
We use Webmin / Virtualmin to simplify management of our development and test servers with cPanel used to run the production servers. Most of the php software we develop and CMSes we use either require or prefer to have php 5.4+. However Webmin / Virtualmin come with PHP 5.1 and PHP 5.3 for CentOS 5 and CentOS 6 respectively. Obviously these are VERY outdated version that are end of life and as such should really be updated to something later. The problem is however there is no information on webmin / virtualmin website on how to do this properly. The information is pretty poor on this topic in general.
The reality is this process is extremely simple and there is nothing that special about a CentOS system running Webmin / Virtualmin to help with management compared to a standard CentOS system (at least as far as PHP is concerned).
What you basically need to do is:
- Install a yum repo that has php 5.4 or whatever version you are after
- Run yum update to update to the appropriate version
The are two up-to-date yum repos out there:
- Remi – http://blog.famillecollet.com/pages/English-site-introduction
- Webtatic – https://webtatic.com/
Both websites have information on how to install the repos and if you’ve found yourself here you should take a bit of time and learn about yum repo management and what remi and webtatic are by going to those sites (which is why I’m not copy pasting how to install the repos here).
After that you will need to run yum –enablerepo=appropriate-repo update php\*. For remi you can read more about it on the following page http://blog.famillecollet.com/post/2014/06/27/PHP-5.4.30-and-5.5.14
Hope this helps someone trying to do the same thing.