location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
注意需要把这段内容前面的注释符号去掉.而且注意这边我替换的$document_root.也可以用项目路径替换.推荐写成变量.
在ngixn不解析php文件.需要配置下面
最新推荐文章于 2024-06-21 11:58:16 发布