新聞中心
centos 上用yum安裝php版本太低了是5.3的,所以要更新下yum源
十多年建站經驗, 成都網站制作、成都網站設計、外貿營銷網站建設客戶的見證與正確選擇。創(chuàng)新互聯提供完善的營銷型網頁建站明細報價表。后期開發(fā)更加便捷高效,我們致力于追求更美、更快、更規(guī)范。
配置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,細心的用戶可能已經發(fā)現ZendGuardLoader變成Zend OPcahe了。
對從PHP5.5開始PHP代碼緩存從APC變成了Zend OPcache了。
補充:可用此方式進行PHP升級。
當前文章:centos6.8安裝php5.5,php5.6,php7
文章轉載:http://ef60e0e.cn/article/jpseeg.html