打开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目录。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM