When I set up a site on my server I set permissions to /var/www/ like so:
chown -R $USER:$USER var/www/
However, when I try and write to my image directory I get a permission denied error. The only way I have found is setting the permissions like this:
chown -Rf www-data.www-data /var/www/
So this fixes that problem, but creates another one. Now I cannot save any files to my server via ftp on my ide.
I'm a bit new to this and don't fully understand the difference between the two ways of setting permissions. Any help would be appreciated.
EDIT Not a dupe. I've done my research. This is not an issue about using sudo in /var/www. I'm getting permission denied errors when generating and trying to save images to a specific directory using GD Lib.