执行命令添加epel源
centos7
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
centos6
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm ( centos 6 如果是centos 7 将 el6 改为 e17 )
rpm -Uvh http://mirrors.ustc.edu.cn/epel/epel-release-latest-6.noarch.rpm
查看php的安装包
yum list | grep php
yum安装(根据需要安装自己所需要的版本以及插件)
yum -y install php71w-devel-7.1.24-1.w7.x86_64 php71w-cli-7.1.24-1.w7.x86_64 php71w-fpm-7.1.24-1.w7.x86_64 php71w-mysql-7.1.24-1.w7.x86_64 php71w-common-7.1.24-1.w7.x86_64 php71w-pdo-7.1.24-1.w7.x86_64
启动php-fpm
php-fpm