Default file permissions for php user www-data
Posted
by
John Isaacks
on Ask Ubuntu
See other posts from Ask Ubuntu
or by John Isaacks
Published on 2011-01-17T16:27:23Z
Indexed on
2011/01/17
16:59 UTC
Read the original article
Hit count: 341
I have a php installed on my ubuntu machine. The web root is /var/www
I set the permissions for this folder like so:
sudo chown -R ftpuser:www-data /var/www
ftpuser is the user I set up so I can ftp to /var/www from another machine on the network. www-data is the user php uses. I double checked using whoami
from php.
Whenever I ftp upload a new file to the machine the group has no permissions to the file. So when I try to access it in my browser via machine-name/new-file.php
I am told permission denied and I have to go and chmod
the new file.
I am wondering if there is a way I can default the www-data user/group to have access permissions to new files so I don't have to keep chmod every new file?
© Ask Ubuntu or respective owner