centos下安裝php5.6的方法:首先查看系統(tǒng)中已有的php版本;然后執(zhí)行【yum -y remove】命令進(jìn)行刪除;接著添加yum源;最后執(zhí)行【yum install -y remi-php56】命令進(jìn)行安裝即可。
首先查找系統(tǒng)中已有的版本
(推薦教程:php圖文教程)
yum list installed | grep php
如果存在已有的php版本 ,執(zhí)行下面的命令刪除
yum -y remove php-common
然后以centos6系統(tǒng)為例,添加CentOS 6.x的yum源
(視頻教程推薦:php視頻教程)
rpm -Uvh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
最后使用yum命令安裝 PHP,安裝5.6版本為remi-php56,安裝5.5版本為remi-php55
yum install -y --enablerepo=remi,remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-commo