php required_once 致命错误 base_dir bug

php required_once Fatal error base_dir bug

大家好!

我遇到了一个奇怪的错误:

Warning: require_once(): open_basedir restriction in effect. File(/usr/lib/php/api/api.conf.php) is not within the allowed path(s): (/var/www/vhosts/admin.eatsalad.fr/subdomains/dev:/usr/lib/php/:/tmp:/var/www/html/dnpanel/) in /var/www/vhosts/admin.eatsalad.fr/subdomains/dev/system/include_libs.php on line 3

好吧,我试着得到 /usr/lib/php/api/api.conf.php,这显然在 /usr/lib/php/

文件存在,我是否需要使用 chmod?
我在这里搜索,但除了关于 "file as folder open_basedir bug" 之类的错误,我一无所获。

感谢帮助者 =) !


解决方案

好的,解决方法来了,dnpanel 所有 "sub" 网站都在监狱里 所以,即使在 php 我写下了 /usr/lib/php,实际上,文件在 /httpjail/usr/lib/php.

而且,显然,我的库在 /usr/lib/php 中,这不是好的真实路径。

感谢大家所做的一切;)

根据 this answer 向设置中列出的目录添加斜杠将防止要求该目录的子目录中的文件。

如果你查看你的设置 /var/www/vhosts/admin.eatsalad.fr/subdomains/dev:/usr/lib/php/:/tmp:/var/www/html/dnpanel/,这意味着你不能从 /user/lib/php

中的子目录中获取文件

解决方案

好的,解决方法来了,dnpanel 所有 "sub" 网站都在监狱里 所以,即使在 php 我写下了 /usr/lib/php,实际上,文件在 /httpjail/usr/lib/php.

而且,显然,我的库在 /usr/lib/php 中,这不是好的真实路径。

感谢大家所做的一切;)