博主信息
博文 40
粉丝 0
评论 1
访问量 50040
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
Yii2部署Nginx时报错
Dong.
原创
1570人浏览过

报错信息: 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/";

两种方法任选其一即可

本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学