Re: chmod()



MS wrote:
> Warning: chmod(): Operation not permitted in
> /home/mysite/public_html/test/admin/php-bin/create_test.php on line 13
>
> my question is.. for what reason is the chmod operation not permitted?
>

The chmod operation can only be executed by the owner of the file or when
the original permissions allow it (which usually means that the files should
have a 777 permission already).

So, when you upload a file to a server, you will be the owner and the file
permissions are set to 644 by default (read-write/read/read) and only you
are allowed to modify it. If you want your script to be able to manipulate
files on your web server, these files should have a 777 permission, after
which chmod will work fine.

Of course this isn't very safe and it's wise to limit 777 file permissions
in a designated directory only.

BTW, this doesn't apply to files which are uploaded through a PHP script, as
these files will be owned by your web server.


JW



.



Relevant Pages

  • Re: Object permissions
    ... Who is the owner of the query? ... permissions does the owner have on the underlying tables? ... does the user have on the query; ... to 'owners' in the sql statement each time the code runs, ...
    (microsoft.public.access.security)
  • Re: Security without signon
    ... I cannot change the owner of the ... rather than inherited permissions by virtue of group membership. ... the default Admin user is the same across all mdw files. ... accounts plus the account for my SuperUser and the account for my SuperGroup, ...
    (microsoft.public.access.security)
  • Re: Permissions denied ifcfg-eth0
    ... network-functions because it wants to access ifcfg-eth0) ... Copy the EXACT error messages. ... is for the owner of the file. ... Further, processes running _as_root_ ignore permissions, because root is ...
    (alt.os.linux.redhat)
  • Re: NTFS folder permissions - Creator Owner issue (I think)
    ... From what you're telling me an owner has rights that cannot ... which seems to include the right to change permissions whether we ... >> the grant to Creator Owner becomes a real grant to the creator or the ...
    (microsoft.public.security)
  • Re: Shared folder security tab...Windows 2003 server
    ... A user that creates a file/folder will be the owner of such and be able to ... change permissions on them even if they have no explicit permissions. ... security tab on all the client computers. ... While this worked for local folders ...
    (microsoft.public.windowsxp.security_admin)