开发者

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

开发者 https://www.devze.com 2023-01-27 11:25 出处:网络
Warning: unlink() [function.unlink]: open_basedir restriction in effect. File() is not within the allowed path(s):

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 i开发者_Python百科n 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消