Directory and file permissions on a virtual host
| From: | Al | Date: | Mon, 14 Mar 2005 21:06:31 +0000 |
| Subject: | Directory and file permissions on a virtual host | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-210694@lists.php.net to get a copy of this message | ||
Would some please provide me some simple rules for dealing with php scripts to fopen(), copy() and move_uploaded_file().
Environment is Linux, Apache on a virtual host
I've spent a lot of time goggling, etc. and can find lot's of explanations for owner, group and world. They sound great; but don't work for me.
This stuff worked on our previous host, it simply assigned "customer" to everything
Here is my directory structure and permissions:
/foo [user accessed php scripts] permissions= 755
/foo/data [simple text files] permissions = 777
files in /data permissions= 644
Have tried lots of other dir and file permissions
owerships are our site handle.
All I want to do is have the user http upload a file
and use move_uploaded_file() to put it in my /foo/data
Then later, a script fopen()s the file to read an append data to it.
Just prior to appending to the file, I use copy() and rename it to anyname.bak
I've fooled around around with shell access and chown and chmod to make things work; but, I can't believe this is necessary.
Of course, once the script can't access the file, it can't change the permissions or ownership
Help.