By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,748 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,748 IT Pros & Developers. It's quick & easy.

chmod & Operation not permitted

P: n/a
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

---
"If there is a God, he must be a sadist!"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Jul 17 '05 #2

P: n/a
Jon Kraft <jo*@jonux.co.uk> wrote in message news:<bn*************@ID-175424.news.uni-berlin.de>...
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


Thanks a lot. Indeed, yours explanation is the only explanation that
I've seen on the net.

---
"Every one has the right to refute any opinion. But no one has the
right to prevent its expression"---Periyar, Famous Tamil Rationalist
Email: rrjanbiah-at-Y!com
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.