当前位置:Gxlcms > PHP教程 > lnmp无法解析php文件,可以访问html文件访问PHP文件直接下载

lnmp无法解析php文件,可以访问html文件访问PHP文件直接下载

时间:2021-07-01 10:21:17 帮助过:73人阅读

下面是我在nginx下面修改过的配置文件
nginx和php-fpm都可以正常启动9000端口也正常,可以访问html文件,不能访问php文件,
访问php文件的时候直接下载,这是我nginx.conf的配置
location / {
43 root html;
44 index index.html index.htm index.php;
45 }
location ~ .php$ {
59 root /usr/html;
60 fastcgi_pass 127.0.0.1:9000;
61 fastcgi_index index.php;
62 fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
63 #include fastcgi.conf;
64 include fastcgi_params;
请哪位大神指点下


回复讨论(解决方案)

这么久了,没有一个让你知道吗

有哪位遇到过这问题帮忙解决下

那是因为你没有配置好参数。nginx不能解析php文件

人气教程排行