Re: Chmod question
| From: | php3 at developersdesk dot com | Date: | Wed, 04 Oct 2000 01:27:58 +0000 |
| Subject: | Re: Chmod question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18498@lists.php.net to get a copy of this message | ||
Addressed to: webmaster@unni.com
php-general@lists.php.net
** Reply to note from Web Master <webmaster@unni.com> Tue, 03 Oct 2000 10:28:16 -0600
>
> It is little off the topic, still, I know, some of you can answer my
> question. How do we give a directory write permission, so that, we could
> create a file on the directory on the fly from PHP script?
>
the directory either needs to be writable by world, (not a good idea) or
writable by the user or group that apache runs as.
Apache runs as nobody:nogroup so I create a directory 'upload' like this:
mkdir upload
chown nobody:nogroup upload
chmod 770 upload
Now the web server can read and write files in this directory, but most
people logged into the system can't. You need to login as root to do this.
If you are uploading files from the world into this directory, you probably
do not want it inside the web directory of a site.
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com