centos yum源是没有php的安装包,修改使用webtatic,remi的源
扩展源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
php源
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
查看yum已安装的php和相关扩展
yum list |grep 'php'
卸载已安装的php和相关依赖扩展(根据上面查询的文件名适当修改)
yum remove php56w php56w-*
安装php7.1
yum install php71w php71w-fpm
yum install php71w-bcmath php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-odbc php71w-opcache php71w-pdo php71w-pdo_dblib php71w-pear php71w-pecl-* php71w-phpdbg php71w-xml php71w-xmlrpc
配置好nginx后重启php-fpm
service nginx restart
service php-fpm restart