技术饭
nginx 访问 .php文件变成下载
copylian
0 评论
24590 浏览
2020.11.09
Nginx 浏览.php文件变成下载:这是因为nginx没有设置好碰到php文件时,要传递到后方的php解释器。
看看你的nginx.conf配置,里面有没有这样的设置:
location ~ .*\.php$ {
fastcgi_pass 127.0.0.1:9000;
}
如果有的话
执行 netstat -antp
发现没有9000端口被占用。所以说我们要启动9000端口
执行:php-cgi -b 127.0.0.1:9000 &
重启php-fpm:systemctl restart php-fpm
重启nginx:systemctl restart nginx

感谢你的支持,我会继续努力!

扫码打赏,感谢您的支持!
文明上网理性发言!