CentOS7的 php7 简易升级教程

OS:CentOs 7

1.查看当前 PHP 版本

[root@disconf zbox]# php -v

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

2.查看当前 PHP 相关的安装包,删除之

yum list installed | grep php

yum remove php

yum remove php-*

3.更换 RPM 源

#Centos 5.X:

rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm

#CentOs 6.x:

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

#CentOs 7.X:

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

4.安装新的版本

yum install -y php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-opcache php71w-pdo php71w-xml php71w-ldap php71w-mcrypt

5.再次检查版本

[root@disconf zbox]# php -v

PHP 7.1.27 (cli) (built: Mar 10 2019 16:23:55) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

with Zend OPcache v7.1.27, Copyright (c) 1999-2018, by Zend Technologies

-- The End --

原文发布于微信公众号 - PHP技术大全(phpgod)

原文发表时间:2019-04-18

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券