1、配置yum源
2、追加centos 6.5的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
3、使用yum list命令查看可安装的包(packege)。
# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
4、安装php5.6
5、yum源配置好了,下一步就安装php5.6。
# 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
6、用php命令查看版本。
# php --versionphp 5.6.0 (cli) (built: sep 3 2014 19:51:31)copyright (c) 1997-2014 the php groupzend engine v2.6.0, copyright (c) 1998-2014 zend technologies with zend opcache v7.0.4-dev, copyright (c) 1999-2014, by zend technologies with xdebug v2.2.5, copyright (c) 2002-2014, by derick rethans
在这里安装的版本是php5.6.0,细心的用户可能已经发现zendguardloader变成zend opcahe了。
对从php5.5开始php代码缓存从apc变成了zend opcache了。
以上就是在centos上php5.6怎么安装?的详细内容。
