默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案:

1 . 检查当前安装的PHP包

yum list installed | grep php

如果有安装的PHP包,先删除他们

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64

2 .

CentOs 6.x

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

CentOs 7.X

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

如果想删除上面安装的包,重新安装

rpm -qa | grep remi
rpm -e 上面搜索到的包即可

3.运行yum install

yum install --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-common

4.安装PHP FPM

yum install php56-fpm