I am using mkdir function in php and I use sudo chown -R www-data:www-data /var/www/html/
than I am able to mkdir folder. But than I am not able to edit any file in /var/www/html/
. So I tried both below method :
sudo chown -R www-data:username /var/www/html/
and
sudo chown -R username:www-data /var/www/html/
But In that mkdir stops working giving permission denied error. How to give permission to both www-data and myself both.