My new Virtualmin server is Centos 7 but the php version is PHP 5.4.16 which is old, no updates for it. How can I update that safely? Is there a safe repository I can use?
Please google up Centos 7 and backporting. There are huge amount of articles explaining what is going on. To put it short - your PHP is fine, updated and secured from all know bugs/exploits.
I updated to PHP 7.1 with the following procedure:
- install EPEL
rpm -ivh epel-release-latest-7.noarch.rpm
- Install REMI repo:
rpm -Uvh remi-release-7.rpm
- Configure the new repo to download PHP 7.1 and replace your old (current) php:
–> In [remi-php71], be sure you have: enabled=1
–> In [remi] be sure you have: enabled=0
–> in [remi-safe] be sure you have: enabled=1
yum clean all
I did this based on: http://ilovevirtualmin.com/tag/virtualmin-upgrade-php-5-3-to-php-5-4/.
Please check the recomendations on apache’s php conf
Hope it helps
You can have multiple PHP versions installed. I just installed 5.6.5 in addition to 5.4.16 in CentOS 7.3. I did it because I was running into software that wouldn’t install unless PHP was higher than 5.4.
I followed the instructions here: https://virtualmin.com/documentation/web/multiplephp#toc-installing-php-56-on-centos-7-wHWbead3
With the exception that the rpm url returned a 404, so Used this one instead:
Worked without any issues. Just need to visit any virtual domain that needs the higher version and select it.
Thank you, that worked perfectly!
Most web software that I use which utilize php announced that they were no longer supporting php 5.4 about 3-6 months ago.
I haven’t upgraded from 7 to 7.1 yet because 7.1 came out so close on the heels to 7.0 and I haven’t read any security updates stating that you should. (coming from my old network infrastructure/security experience not that I’m any Linux expert by any stretch of the imagination)
My install of CentOS 7 already had a multi edition of php from 5.6 to 7.0. Of course Linode purposefully adds or subtracts items to make it easier to customize so I may have just been blessed.