Kamis, 11 Juni 2020

UPGRADE PHP7-centos7

I’m assuming that you are running a stock installation of CentOS, and already have PHP 5.4 installed.

1. VERIFY CURRENT VERSION OF PHP

Type in the following to see the current PHP version:
1
php -v
The output should match this:
1
2
3
PHP 5.4.16 (cli) (built: Apr 12 2018 19:02:01)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Cool, let’s move on!

2. INSTALL THE REMI AND EPEL REPOSITORIES

If you don’t already have them, install the Remi and EPEL repositories:
1
2
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
Enable the Remi repository globally:
1
nano /etc/yum.repos.d/remi.repo
Under the section that looks like [remi] make the following changes:
1
2
3
4
5
6
7
8
[remi]
name=Remi's RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/remi/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/remi/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/remi/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Type CTRL-O to save and CTRL-X to close the editor
Enable the Remi PHP7.3 Repository:
1
nano /etc/yum.repos.d/remi-php73.repo
Under the section that looks like [remi-php73] make the following changes:
1
2
3
4
5
6
7
8
[remi-php73]
name=Remi's PHP 7.3 RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/php73/$basearch/
mirrorlist=https://rpms.remirepo.net/enterprise/7/php73/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/php73/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Make sure you un-comment the HTTPS mirror-list as well. The HTTP mirror seems to run into issues every now and then.
Type CTRL-O to save and CTRL-X to close the editor

3. UPGRADE PHP 5.4 TO PHP 7.3

Now we can upgrade PHP. Just type in the following command:
1
yum -y upgrade php*
Once the upgrade has completed, verify that you have PHP 7.3 installed:
1
php -v
Output should look like:
1
2
3
PHP 7.3.0RC5 (cli) (built: Nov  6 2018 10:22:47) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
You’re now running with PHP 7.3!

Tidak ada komentar:

Posting Komentar