Correct permissions for /var/www/html
First, you should ensure that your username is included in www-data group. If not, you can add your username as www-data group
sudo adduser $USER www-data
After that, you should change the ownership of /var/www to your username
sudo chown $USER:www-data -R /var/www
Next step, you should change permission to 755, not recommend changing permission to 777 for security reason
sudo chmod 0755 -R /var/www
sudo chmod g+s -R /var/www
Hope it helps…

use these commands if you are facing permission and you are unable to write/create file/folder under /var/www/html folder