在运行时错误中通过chmod更改权限,并显示“不允许操作". [英] Changing permissions via chmod at runtime errors with "Operation not permitted"

查看:2206
本文介绍了在运行时错误中通过chmod更改权限,并显示“不允许操作".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在运行时使用chmod()更改权限时,会显示以下消息:

When I use chmod() to change permissions at run time, it gives me the below message:

警告:chmod()[function.chmod]:/home/loud/public_html/readalbum.php不允许操作

Warning: chmod() [function.chmod]: Operation not permitted in /home/loud/public_html/readalbum.php

如何清除此错误并使chmod函数正常工作?

How can I remove this error and make the chmod function work?

推荐答案

$ sudo chmod ...

您需要是文件的所有者或超级用户,即用户 root .如果您拥有目录而不是文件,则可以复制该文件,将其保留为原始文件,然后将其复制回去,然后就可以对其进行销毁了.

You need to either be the owner of the file or be the superuser, i.e., user root. If you own the directory but not the file, you can copy the file, rm the original, then mv it back, and then you will be able to chown it.

临时成为root的简单方法是通过sudo运行命令. ($ man 8 sudo)

The easy way to temporarily be root is to run the command via sudo. ($ man 8 sudo)

这篇关于在运行时错误中通过chmod更改权限,并显示“不允许操作".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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