Q:open_basedir restriction in effect

魔众轻量论坛系统 / 文档中心
文档中心
开发教程
安装常见问题

提示如下错误

require(): open_basedir restriction in effect ***

open_basedir 设置是防跨站攻击的,出现这个错误需要进行如下设置。

Nginx 参考处理

在网站的 Nginx 配置增加

server {
    # ...
    location ~ \.php$ {
        # ...
        # 需要设置到网站根目录 www.example.com
        fastcgi_param  PHP_VALUE  "open_basedir=/var/www/html/www.example.com/:/tmp/:/var/tmp/";
        # ...
    }
    # ...
}

Apache 参考处理

在 http.conf 文件内加上

# 需要设置到网站根目录
php_admin_value open_basedir E:/wwwroot/www.example.com
QQ
微信
公众号