0

How would I, with security in mind, allow www-data to create directories within /var/www/html/assets/img and its sub-directories?

I have a PHP script that automatically creates directories with 777 permissions, but www-data currently doesn't have the required permissions to allow that.

1 Answer 1

2

Try changing the owner and group of that directory to www-data and setting permissions for owner/group to rwx

sudo chown -R www-data:wwwdata /var/www/html/assets/img
sudo chmod -R 755 /var/www/html/assets/img

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .