Reply to Re: chmod()

Your name:

Reply:


Posted by Janwillem Borleffs on 05/28/05 23:26

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация