1. 程式人生 > >Centos 7.x yum安裝php5.6.X(最新版)

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