开发者

Unable to chmod files: "Operation not permitted"

开发者 https://www.devze.com 2023-01-02 06:27 出处:网络
i want to delete files from a directory via php. Somehow my php_errorlog always tells me: [06-Jun-2010 19:38:46] PHP Warning:chmod() [function.chmod]: Operation not permitted in /Users/myname/htdocs

i want to delete files from a directory via php. Somehow my php_errorlog always tells me:

[06-Jun-2010 19:38:46] PHP Warning: chmod() [function.chmod]: Operation not permitted in /Users/myname/htdocs/

if ($_POST) {
        echo "yeah!!!";
        print count($_POST['deletefiles']);
        chmod($path, 0777); //server rights
        foreach ($_POST['deletefiles'] as $value) {
            print $value;
            unlink($path开发者_如何学Go .'/' . $value);
        }
        //chmod($path, 0666); //server rights
    }

what am I doing wrong? Thank you


Does the user PHP is running as have write access to the files you're attempting to chmod? Remember that this user is most likely not the same as your own account.


chmod these files to 0666 using your FTP client first.

0

精彩评论

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