basedir限制有效。 文件(/)不在允许的路径中:

我在我的网站上通过头像上传出现此错误。 我从来没有得到它,最近没有什么变化,我开始得到这个错误...

Warning: is_writable() [function.is-writable]: 
open_basedir restriction in effect. 
File(/) is not within the allowed path(s):

修改您的PHP配置中的open_basedir设置(请参阅运行时配置)。

open_basedir设置主要用于防止特定用户的PHP脚本访问另一用户帐户中的文件。 所以通常情况下,您自己帐户中的任何文件都应该可以由您自己的脚本读取。

如果PHP在Linux系统上作为Apache模块运行,则通过.htaccess设置的示例如下:

<DirectoryMatch "/home/sites/site81/">
    php_admin_value open_basedir "/home/sites/site81/:/tmp/:/"
</DirectoryMatch>

修改您的主机帐户中的open_basedir设置并将其设置为无。 找到您的Plesk / cPanel的“PHP设置”区域下给出的open_basedir设置。 将其设置为'没有'从那里给出的下拉列表中。 我已经在Plesk面板图片中显示了它们。

在这里输入图像描述在这里输入图像描述


要解决此错误,您必须编辑文件httpd.conf。 之前可以在phpinfo中看到的方式在apache2handler section directive Server Root中。 例如,在我这种情况下 - / etc / httpd / httpd.conf。 打开文件httpd.conf,找到提及的参数open_basedir。 并将其设置为无。 ( php_admin_value open_basedir无

链接地址: http://www.djcxy.com/p/11883.html

上一篇: basedir restriction in effect. File(/) is not within the allowed path(s):

下一篇: What does the PHP error message "Notice: Use of undefined constant" mean?