Need to update php in Centos 7

6 posts / 0 new
Last post
#1 Sun, 01/29/2017 - 20:36
vectorsites

Need to update php in Centos 7

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?

Mon, 01/30/2017 - 02:29
Diabolico
Diabolico's picture

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 often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Mon, 01/30/2017 - 13:16
CaeSpock

I updated to PHP 7.1 with the following procedure:
1. install EPEL

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
  1. Install REMI repo:
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm
  1. Configure the new repo to download PHP 7.1 and replace your old (current) php:
cd /etc/yum.repos.d/
vi remi-php71.repo
--> In [remi-php71], be sure you have: enabled=1
vi remi.repo
--> In [remi] be sure you have: enabled=0
vi remi-safe.repo
--> in [remi-safe] be sure you have: enabled=1

4 Update

yum clean all
yum update
  1. check:php -v


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

Carlos

Tue, 01/31/2017 - 14:51
webwzrd

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-...

With the exception that the rpm url returned a 404, so Used this one instead: https://www.softwarecollections.org/repos/rhscl/rh-php56/epel-7-x86_64/n...

Worked without any issues. Just need to visit any virtual domain that needs the higher version and select it.

Wed, 02/01/2017 - 15:58 (Reply to #4)
vectorsites

Thank you, that worked perfectly!

Fri, 02/10/2017 - 14:50
ftbseobrad
ftbseobrad's picture

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.

Topic locked