ENV:
[root@centos7 ~]# uname -r
3.10.0-514.el7.x86_64
[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@centos7 ~]# rpm -qa|grep nginx
nginx-release-centos-7-0.el7.ngx.noarch
nginx-1.16.0-1.el7.ngx.x86_64
为了保证系统上php的干净,已经remove掉php的所有相关安装文件
[root@centos7 ~]# yum remove php*
[root@centos7 ~]# rpm -qa|grep php
[root@centos7 ~]#
由于centos7的安装库带有php的相关文件,可以直接安装,如不想使用原带的php(版本太低,只是5.4版的,想安装高版本,用到epel)
[root@centos7 ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm Retrieving https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
warning: /var/tmp/rpm-tmp.V0soJ9: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:webtatic-release-7-3 ################################# [100%]
安装好后查看下php的版本(新版的7.0,7.1,7.2都有了):
[root@centos7 ~]# yum list|grep php7
mod_php71w.x86_64 7.1.27-1.w7 webtatic
mod_php72w.x86_64 7.2.16-1.w7 webtatic
php70w.x86_64 7.0.33-1.w7 webtatic
php70w-bcmath.x86_64 7.0.33-1.w7 webtatic
php70w-cli.x86_64 7.0.33-1.w7 webtatic
php70w-common.x86_64 7.0.33-1.w7 webtatic
php70w-dba.x86_64 7.0.33-1.w7 webtatic
php70w-devel.x86_64 7.0.33-1.w7 webtatic
php70w-embedded.x86_64 7.0.33-1.w7 webtatic
php70w-enchant.x86_64 7.0.33-1.w7 webtatic
php70w-fpm.x86_64 7.0.33-1.w7 webtatic
php70w-gd.x86_64 7.0.33-1.w7 webtatic
php70w-imap.x86_64 7.0.33-1.w7 webtatic
php70w-interbase.x86_64 7.0.33-1.w7 webtatic
php70w-intl.x86_64 7.0.33-1.w7 webtatic
php70w-ldap.x86_64 7.0.33-1.w7 webtatic
php70w-mbstring.x86_64 7.0.33-1.w7 webtatic
php70w-mcrypt.x86_64 7.0.33-1.w7 webtatic
php70w-mysql.x86_64 7.0.33-1.w7 webtatic
php70w-mysqlnd.x86_64 7.0.33-1.w7 webtatic
php70w-odbc.x86_64