CentOS7使用yum安装LNMP环境以后无法打开php页面

  CentOS7使用yum安装LNMP环境以后无法打开php页面

  页面提示为File not found

  查看nginx错误日志/var/log/nginx/error.log提示如下

  原因分析

  nginx的配置文件问题

  但是,如果你在nginx.conf 中设置了设置你本地的 root 目录(服务根目录),例如:

root           /usr/share/nginx/html;

  那么需要将 fastcgi_param 参数修改为:

  默认配置为

fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

  修改为

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

  重启php-fpm和nginx即可

systemctl restart nginx
systemctl restart php-fpm

原文地址:https://www.cnblogs.com/minseo/p/8820433.html