开发者社区 问答 正文

Ln建立的软链接文件夹中的文件无法require

一个网站中的文件夹要在同服务器的另一个网站中有用到,不想来回复制麻烦,试着用ln -s命令在另一个网站项目下生成软链接,然后发现无法require。自己阿里云上测试一下却可以,请问是怎么回事?

错误提示是:

Warning: require_once(): open_basedir restriction in effect. File(/www/web/jyamd/system/db_config.php) is not within the allowed path(s): (/www/web/jycf:/tmp) in /www/web/jycf/public/test.php on line 4
Warning: require_once(/www/web/jyamd/system/db_config.php): failed to open stream: Operation not permitted in /www/web/jycf/public/test.php on line 4
Fatal error: require_once(): Failed opening required '../system/db_config.php' (include_path='.:/www/wdlinux/apache_php-5.4.26/lib/php') in /www/web/jycf/public/test.php on line 4

展开
收起
a123456678 2016-06-28 11:38:08 2947 分享 版权
1 条回答
写回答
取消 提交回答
  • 找到网站的这一段,把目录限制改为:

    php_admin_value open_basedir /www/web
    就可以了。

    2019-07-17 19:48:07
    赞同 展开评论
问答分类:
PHP
问答地址: