Blogger Information
Blog 40
fans 0
comment 1
visits 39761
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Yii2部署Nginx时报错
Dong.
Original
1227 people have browsed it

报错信息: Fatal error: require(): Failed opening required ‘/www/wwwroot/xxxxxx/public/../thinkphp/start.php

  1. Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/xxxxxx/thinkphp/start.php) is not within the allowed path(s): (/home/wwwroot/xxxxxx/public/:/tmp/:/proc/) in /home/wwwroot/xxxxxx/public/index.php on line 16
  2. Warning: require(/home/wwwroot/xxxxxx/thinkphp/start.php): failed to open stream: Operation not permitted in /home/wwwroot/xxxxxx/public/index.php on line 16
  3. Fatal error: require(): Failed opening required ‘/www/wwwroot/xxxxxx/public/../thinkphp/start.php (include_path=’.:/usr/local/php/lib/php’) in /home/wwwroot/xxxxxx/public/index.php on line 16

解决方案:

1、在设置网站目录中,不要勾选防跨站攻击,问题解决。

2、进入/www/server/nginx/conf目录下,找到fastcgi.conf,修改其中的一个参数’fastcgi_param PHP_ADMIN_VALUE’,没有的话可以自己加一个,/www/wwwroot是你的项目路径,每个人可能都不一样
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/www/wwwroot/:/tmp/:/proc/";

两种方法任选其一即可

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post