1. 添加Centos7的epel及remi源:
1 | yum install epel-release |
2.使用yum list命令查看可安装的包:
1 | yum list --enablerepo=remi --enablerepo=remi-php56 | grep php |
3. 使用yum install 命令安装php5.6:
1 | 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并设置为开机自启动:
1 | yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm |
5. 查看PHP版本:
1 | php -v |