取消关联失败 - > open_basedir问题警告:unlink()[function.unlink]:open_basedir限制有效。 File()不在允许的路径中: [英] Unlink Fails -> open_basedir issue Warning: unlink() [function.unlink]: open_basedir restriction in effect. File() is not within the allowed path(s):
本文介绍了取消关联失败 - > open_basedir问题警告:unlink()[function.unlink]:open_basedir限制有效。 File()不在允许的路径中:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
就是我得到的代码
< pre $
if(file_exists($ thumb)){
echo< b> $ thumb< / b>;
$ fh = fopen($ thumb,'w')或死(无法打开文件);
fclose($ fh);
unlink($ myFile);
}
我可以确认$ thumb的路径是正确的。
任何修正?
在此先感谢。
解决方案
查看你的php.ini设置。 open_basedir配置设置限制了您的PHP脚本可以访问的文件系统的哪些区域;如果您要删除的文件在指定的目录之外,则unlink()调用将失败。
Warning: unlink() [function.unlink]: open_basedir restriction in effect. File() is not within the allowed path(s):
is what i'm getting for the code
if (file_exists($thumb)) {
echo "<b>$thumb</b>";
$fh = fopen($thumb, 'w') or die("can't open file");
fclose($fh);
unlink($myFile);
}
I can confirm that the path of $thumb is correct.
Any fixes?
Thanks in advance.
解决方案
Look in your php.ini setup. The open_basedir configuration setting restricts which areas of the filesystem your PHP script can access; if the file you're trying to delete is outside any directories specified there the unlink() call will fail.
这篇关于取消关联失败 - > open_basedir问题警告:unlink()[function.unlink]:open_basedir限制有效。 File()不在允许的路径中:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文