无法 chmod 文件:“不允许操作”
我想通过 php.ini 从目录中删除文件。 不知怎的,我的 php_errorlog 总是告诉我:
[06-Jun-2010 19:38:46] PHP 警告:chmod() [function.chmod]:/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 .'/' . $value);
}
//chmod($path, 0666); //server rights
}
我做错了什么?谢谢
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 .'/' . $value);
}
//chmod($path, 0666); //server rights
}
what am I doing wrong? Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PHP 正在运行的用户是否对您尝试 chmod 的文件具有写入权限?请记住,该用户很可能与您自己的帐户不同。
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.
首先使用 FTP 客户端将这些文件 chmod 为 0666。
chmod these files to 0666 using your FTP client first.