温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos 6.8 安装php5.5,php5.6,php7

发布时间:2020-07-10 23:34:50 来源:网络 阅读:8273 作者:skinglzw 栏目:web开发

centos 上用yum安装php版本太低了是5.3的,所以要更新下yum源


配置yum源

追加CentOS 6.8的epel及remi源。


# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm


以下是CentOS 7.0的源。


# yum install epel-release

# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm


使用yum list命令查看可安装的包(Packege)。


# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php


安装PHP5.6

yum源配置好了,下一步就安装PHP5.6(更新源后,也可以安装php7 的下面的56改成70)


# yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof



用PHP命令查看版本。


复制代码

# php --version


在这里安装的版本是PHP5.6.0,细心的用户可能已经发现ZendGuardLoader变成Zend OPcahe了。

对从PHP5.5开始PHP代码缓存从APC变成了Zend OPcache了。

补充:可用此方式进行PHP升级。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI