ubuntu server, php, ftp permissions

844 views Asked by At

Ubuntu Server 14.04.1 w/ LAMP and Webmin/proFTP (haven't really used webmin much; too much stuff flying around)

Issue: With my user as owner of /var/www/ I can ftp files to the server, but PHP cannot handle files without www-data as the owner.

I also tried: sudo adduser myUsername www-data sudo chown -R www-data:www-data /var/www/

This still did not allow my user to FTP upload to this directory; changing it back to sudo chown -R myUsername:myUsername /var/www/ allows for FTP again.

How can I setup permissions to able to use FTP and have PHP be able to handle files (cURL, fopen, exec, etc.)?

2

There are 2 answers

0
MeetTitan On

I don't think this is the correct site to ask this question.

However try:

usermod -a -G www-data yourUserName
2
Caleb Pitman On

The folder permission was set to 755, and it should have been 775 (write for group).