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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值