Re: getting "chmod(): Operation not permitted" on attempted file changes
- From: Tim Greer <tim@xxxxxxxxxxxxx>
- Date: Thu, 02 Oct 2008 21:31:28 -0700
javelin wrote:
I have a script that works fine on one server, but not on another. I
upload files thru this script, and am trying to modify them after
this, but I get the following message: "Warning: chmod(): Operation
not permitted"
I was told that this is because the file is created by "nobody", so
only "nobody" may edit the file. Can anyone advise on how to execute
scripts as this "nobody"? Also, how do I display a list of valid
users?
Thanks.
J
Your server has their web service set to run PHP in the web server's
API, and it runs as the global web server user (nobody), instead of the
uid (user ID) of your own user. If a file is created and owned by the
nobody user, it means you'll have to have a script (also running as
nobody) perform the permission change via chmod. However, it can fail
if the directory it's in isn't set to read, write and execute. The
directory itself would need to be owned by the nobody user unless the
world (other) group was allowed read, write and execute.
If your host recently changed from mod_php (Apache API), for example, to
phpsuexec or suPHP, which runs it as CGI as your own user, then any
nobody owned files will need to be changed to your user and group
ownership. However, it sounds like they have it set to run in the
Apache API amd the permissions just need to be set on the directory
that file is in that you want to run chmod against. Ideally, ask your
host for help, unless this is your own server.
By the way, maybe I'm mistaken, did you have the PHP script create the
file and then tried to run chmod via FTP or a control panel interface,
or in shell? This is actually a simple problem and fix, I just don't
want to guess too much about the actual issue and cause any confusion.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
.
- Follow-Ups:
- References:
- Prev by Date: getting "chmod(): Operation not permitted" on attempted file changes
- Next by Date: Re: getting "chmod(): Operation not permitted" on attempted file changes
- Previous by thread: getting "chmod(): Operation not permitted" on attempted file changes
- Next by thread: Re: getting "chmod(): Operation not permitted" on attempted file changes
- Index(es):
Relevant Pages
|