R. Rajesh Jeba Anbiah <ng**********@rediffmail.com> wrote:
For a longtime, I'm searching the answer for the error
Warning: chmod failed: Operation not permitted in /xxx/xxx/ 'cos I
never get success with chmod on the servers I've tried.
Now, while searching the php.notes archives, I came across a note
(http://groups.google.com/groups?thre...0rack1.php.net) that says it is a server/rights problem. But, I could see the note is
deleted (is because it is not true??!!).
Like to know other PHP coders comments. TIA
Hi,
It is very simple really, the user the web server runs as (e.g. www, apache
or nobody) must have the rights to change the mode of the file or
directory.
If safe_mode is enabled, the web server's user must be owner of the file or
directory.
Little example. Let's say there is a file called input.txt and the web
server runs as "www", group "www". Safe mode is disabled.
Here you couldn't change the mode or even write the file as it is only
readable by the group "www":
4 -rw-r--r-- 1 jon www 20 Oct 14 15:30 input.txt
Here you can, as the group "www" has write permission - but only if
safe_mode is off:
4 -rw-rw-r-- 1 jon www 20 Oct 14 15:30 input.txt
Here the file is actually owned by "www" which gives the PHP script full
control even if safe_mode is enabled:
4 -rw-r--r-- 1 www www 20 Oct 14 15:30 input.txt
JOn