note 91599 added to function.chown
| From: | rickard at 0x539 dot se | Date: | Thu, 18 Jun 2009 21:04:51 +0000 |
| Subject: | note 91599 added to function.chown | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157102@lists.php.net to get a copy of this message | ||
For most modern Linux systems your apache user should not be run as root, and in order to change the
ownership of a file or directory, you need to be root. To get around this problem you can use sudo,
but be careful with what permissions you give. Here is an example which is working for me:
www-data ALL = NOPASSWD: /bin/chown 1[1-9][0-9][0-9]\:1[1-9][0-9][0-9] /home/www/[a-zA-Z0-9]*
This allows the apache server to change ownership of files in /home/www with name containing a-z,
A-Z or numbers (note: no subdirectories). The only valid input of userid is a four digit numeric id,
between 1100 and 1999.
Hope this helps.
----
Server IP: 209.41.74.194
Probable Submitter: 82.196.98.112
----
Manual Page -- http://www.php.net/manual/en/function.chown.php
Edit -- https://master.php.net/note/edit/91599
Del: integrated -- https://master.php.net/note/delete/91599/integrated
Del: useless -- https://master.php.net/note/delete/91599/useless
Del: bad code -- https://master.php.net/note/delete/91599/bad+code
Del: spam -- https://master.php.net/note/delete/91599/spam
Del: non-english -- https://master.php.net/note/delete/91599/non-english
Del: in docs -- https://master.php.net/note/delete/91599/in+docs
Del: other reasons-- https://master.php.net/note/delete/91599
Reject -- https://master.php.net/note/reject/91599
Search -- https://master.php.net/manage/user-notes.php