linuxvisual-studio-codefedorafedora-27

Cant write files to /var/www/html using the VS Code editor


I am trying to save a .php file to /var/www/html/mysql using VS Code on Fedora 27 but I get an message saying

enter image description here

Also if I try to open VS Code as root I get the following message:

enter image description here


Solution

  • You need to change access rights to the folder. There are 2 options.

    1. sudo chmod 777 /var/www/html/mysql - Changes access rights to the mysql directory
    2. sudo chmod -R 777 /var/www/html/mysql - Changes access rights to both the mysql directory and all subdirectories inside.