centos7 升级 php 5.4 -> php5.6

centos7 自带php5.4,升级到php5.6的方法:
https://webtatic.com/packages/php56/

CentOS/RHEL 7.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Now you can install PHP 5.6’s mod_php SAPI (along with an opcode cache) by doing:

yum install php56w php56w-opcache

You can alternatively install PHP 5.6’s php-fpm SAPI (along with an opcode cache by doing:

yum install php56w-fpm php56w-opcache

If you know what you are doing, you can upgrade PHP by:

yum install yum-plugin-replace
yum replace php-common --replace-with=php56w-common

执行完毕之后,重启php-fpm、nginx

systemctl restart php-fpm nginx

[root@vue~]# php-fpm -v
PHP 5.6.30 (fpm-fcgi) (built: Jan 19 2017 22:33:30)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
[root@vue~]#

最快的方式 56升级到安装PHP71

yum install yum-plugin-replace
yum replace php56w-common --replace-with=php71w-common

https://webtatic.com/packages/php71/

你可能感兴趣的:(PHP)