①nginx.conf

#server段添加
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}


②重启 ngxin

nginx -s reload

③ 在 html 文件下创建 index.php

vim index.php
<?php
phpinfo();
:wq

④访问:

centos7 php与nginx 整合_vim


了解什么是特征以及如何使用它们的最好方法是观察它们的本质