1、linux的版本为centos6.5 64位
2、查找已有的版本yum list installed | grep php
3、如果存在已有的php版本 ,执行下面的命令删除yum -y remove php-common
4、这里是centos6的系统,所以添加CentOS 6.x的yum 源rpm -Uvh http://dow荏鱿胫协nload.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
5、使用yum安装 PHP,安装5.6版本为remi-php56,安装5.5版本为remi-php5猱蝰逾鸾5yum i荏鱿胫协nstall -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-common
6、通过php -v命令获取安装的php版本,当前版本为php5.6.x