取消链接失败-& gt; 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):

查看:107
本文介绍了取消链接失败-& gt; open_basedir问题警告:unlink()[function.unlink]:open_basedir限制有效. File()不在允许的路径内:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告:unlink()[function.unlink]:open_basedir限制有效. File()不在允许的路径内:

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

这就是我要得到的代码

if (file_exists($thumb)) {
    echo "<b>$thumb</b>";
    $fh = fopen($thumb, 'w') or die("can't open file");
    fclose($fh);
    unlink($myFile);
}

我可以确认$ thumb的路径正确.

I can confirm that the path of $thumb is correct.

任何修复程序?

谢谢.

推荐答案

查看您的php.ini设置. open_basedir配置设置限制了PHP脚本可以访问文件系统的哪些区域.如果您要删除的文件在指定的任何目录之外,则unlink()调用将失败.

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.

这篇关于取消链接失败-&amp; gt; open_basedir问题警告:unlink()[function.unlink]:open_basedir限制有效. File()不在允许的路径内:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆