CentOS7 yum安装php5.6

1. 添加Centos7的epel及remi源:

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

2.使用yum list命令查看可安装的包:

yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

3. 使用yum install 命令安装php5.6:

 yum install --enablerepo=remi --enablerepo=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 --enablerepo=remi --enablerepo=remi-php56 php-fpm 
systemctl enable php-fpm.service

5. 查看PHP版本:

php -v

Comments