[root@localhost html]# netstat -tunlp | grep php
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 113547/php-fpm: mas
php的默认端口是:9000
cd /usr/local/php/sbin && pkill php-fpm #关闭 整合nginx测试php: 修改nginx配置文件并添加以下内容:vi /usr/local/nginx/conf/nginx.conf location ~ \.php$ { root /usr/local/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 修改后对nginx进行重启: /usr/local/nginx/sbin/nginx -s reload FastCGI #是 一个 在HTTP服务器和动态脚本语言间通信的接口 fastcgi_pass 127.0.0.1:9000; #设置监听端口 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #设置脚本文件请求的路径 include fastcgi_params; #引入fastcgi的配置文件 在nginx的网站发布路径下创建index.php文件: vi /usr/local/nginx/html/index.php <?php phpinfo(); ?> 打开浏览器访问 : IP/index.php,能出来就成功了