宝塔面板Flarum安装错误原因分析

错误代码

Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/flarum.todoai.net/site.php) is not within the allowed path(s): (/www/wwwroot/flarum.todoai.net/public/:/tmp/) in /www/wwwroot/flarum.todoai.net/public/index.php on line 10

Warning: require(/www/wwwroot/flarum.todoai.net/site.php): Failed to open stream: Operation not permitted in /www/wwwroot/flarum.todoai.net/public/index.php on line 10

Fatal error: Uncaught Error: Failed opening required '../site.php' (include_path='.:/www/server/php/82/lib/php') in /www/wwwroot/flarum.todoai.net/public/index.php:10 Stack trace: #0 {main} thrown in /www/wwwroot/flarum.todoai.net/public/index.php on line 10

原因分析

宝塔的 open_basedir 只允许访问

/www/wwwroot/flarum.todoai.net/public/
/tmp/

Flarum 的 public/index.php 需要加载:

require '../site.php';

/www/wwwroot/flarum.todoai.net/site.php

结果被 open_basedir 拦截了。

解决方法

宝塔面板:

网站
→ flarum.todoai.net
→ 设置
→ 网站目录
→ 防跨站攻击(open_basedir)

关闭:

防跨站攻击

保存,然后重载 PHP。

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
RackNerd Leaderboard Banner
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索