CENTOS 7 PHP7.2平滑升级到PHP7.3

最近装点东西,需要PHP7.3。网上看了许多办法,基本是删了重装。本人比较懒,偶然间发现了个平滑升级的教程。但是该教程也有点小坑。自己通过各种摸索,终于升级成功。

以下开始:

1.确认你当前安装的php版本:

php -v

2.安装Remi和EPEL数据源

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

3.启用Remi

vi /etc/yum.repos.d/remi.repo

4.更改[remi]区域的代码块为如下,相同则不用更改

[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

5.启用Remi PHP7.3数据源

vi /etc/yum.repos.d/remi-php73.repo

6.更改[remi-php73]区域的代码块为如下

[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

7.升级php到php7.3

yum -y upgrade php*

8.检查php版本

php -v

9.重启php-fpm

service restart php-fpm

3 Replies to “CENTOS 7 PHP7.2平滑升级到PHP7.3”

  1. Hi! I just wanted to ask if you ever have any trouble with hackers?

    My last blog (wordpress) was hacked and I ended up losing months
    of hard work due to no data backup. Do you have any methods to prevent
    hackers?

发表评论

电子邮件地址不会被公开。