1.php-fpm以root权限启动
sudo vim /usr/local/php/etc/php-fpm.d/www.conf
sudo /usr/local/php/sbin/php-fpm -R
2.nginx配置php-fpm为web socket连接
sudo vim /usr/local/nginx/conf/nginx.conf
3.编写php文件
cd /usr/local/nginx/
sudo chmod 777 html/ -R
cd html
vim index.php
4.启动nginx
sudo nginx
5.访问浏览器页面: 你自己的ip地址,或者直接访问localhost/index.php