1. 安装基础开发环境
yum -y groupinstall Development tools
2. 切换资源库
yum -y install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3. 检查并卸载所有已安装的php
yum remove -y php*
4. 安装php和php的模块
yum install -y php72w php72w-mysql php72w-mbstring php72w-mcrypt php72w-gd php72w-imap php72w-ldap php72w-odbc php72w-pear php72w-xml php72w-xmlrpc php72w-pdo php72w-common php72w-fpm php72w-pecl-redis php72w-pecl-memcached php72w-devel
5. 查看版本和查看扩展
php -v
php -m
6. 安装nginx
yum -y install nginx
7. 配置文件默认地址
/etc/php.ini
/etc/php-fpm.conf
/etc/nginx/nginx.conf
8. 服务管理方式
systemctl stop php-fpm.service
systemctl restart php-fpm.servicesystemctl enable nginx.service
systemctl start nginx.service
systemctl stop nginx.service