I connected VS Code to WSL and when I try to save changes in my index.php
file the following message shows up.
I tried to change the permissions on var/www/html
using chmod
but nothing changed.
So how to make VS code modify the file?
Advertisement
Answer
Even I faced the same issue on my linux system, following command solved it:
- Go to that directory from terminal.
- Write
sudo chown -R <username>:<group> <directory_name>
. This command will change ownership (both user and group) of all files and directories inside of directory and directory itself.
To know the username write whoami
in terminal.
To know the group write groups
in terminal (The first name in the list is your group name) for me both username and groupname was same.