0

I just installed LAMP server, which works fine. But when I code a PHP script and try to save it in /var/www/html, it says:

You don't have permisission necessary to save the file

Help me! How do I fix this problem?

enter image description here

anonymous2
  • 4,325

1 Answers1

4

Three quick steps

Add your user to the www-data group

sudo usermod -a -G www-data username

Change the owner of /var/www

sudo chown -R username:www-data /var/www

Change the permissions recursively on /var/www

sudo chmod -R 644 /var/www

NB: Replace username in the commands with your username.

anonymous2
  • 4,325