打开nginx配置的站点报错500

打开站点报错500的原因 有很多,这里只说明一点:nginx 的fastcgi.conf配置引起的问题

 

环境说明

1 站点目录结构

wwwroot

  website

    public

    application

    ……

 

2 nginx 站点配置

server
{
listen 80;
server_name test.aa.com 
index index.html index.htm index.php default.html default.htm default.php;
root /data/wwwroot/website/public;

…………

 

------------------------------------------------------------------------------------------------------------------------------------------------------

需要修改的文件   nginx/conf/fastcgi.conf

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/data/wwwroot/";

注意:增加红色部分

 

原因是:默认的$document_root 只有 对public目录的访问权限,超出这个目录就是没有权限了。比如application目录。

 

posted @ 2019-07-10 15:56  H辉  阅读(3612)  评论(0编辑  收藏  举报