Centos 7.x yum安装php5.6.X(最新版)

1、检查当前安装的PHP包
yum list installed | grep php

如果有安装的PHP包,先删除他们
yum remove php.x86_64 php-cli.x86_64

2、配置yum源  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

安装PHP5.6.x
yum install --enablerepo=remi --enablerepo=remi-php56 php php-fpm php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-gd php-mysql php-pdo php-process gmp gmp-devel bzip2 bzip2-devel libxml2 libxml2-devel libcurl libcurl-devel freetype freetype-devel libmcrypt libmcrypt-devel libxslt libxslt-devel readline readline-devel php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

查看版本
php --version

4、重新启动服务:
在 CentOS 7 系统上:
$ sudo systemctl restart php-fpm

猜你喜欢

转载自blog.csdn.net/dawnsmile113/article/details/83780839