红联Linux门户
Linux帮助

centos6下php5.3升级为php7

发布时间:2017-05-28 09:37:36来源:linux网站作者:fanren224
1、查看版本
[root@web-1 blog]# php -v
No log handling enabled - turning on stderr logging
Created directory: /var/lib/net-snmp/mib_indexes
PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
 
2、卸载
[root@web-1 blog]# yum remove php-common
[root@web-1 yum.repos.d]# php -v
-bash: /usr/bin/php: No such file or directory
 
3、安装yum源
[root@web-1 yum.repos.d]#  rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
 
4、安装php7
[root@web-1 epel]# yum install php70w php70w-opcache
[root@web-1 epel]# php -v
PHP 7.0.18 (cli) (built: Apr 15 2017 07:29:51) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.18, Copyright (c) 1999-2017, by Zend Technologies
 
本文永久更新地址:http://www.linuxdiyf.com/linux/31120.html