Reputation: 1625
When I try to create a new file/folder in PhpStorm I get a Permission denied
error. However, when I create a new file in a folder that already exists in the root directory of my server I can without any errors.
When I try to create a new file:
[2016-03-07 11:29 AM] Failed to transfer file 'C:\Users\D\PhpstormProjects\example2\test.php': could not write to "sftp://www.example.com/test.php". (Permission denied)
[2016-03-07 11:29 AM] Automatic upload completed in less than a minute: 2 items failed
When I try to create a new folder:
[2016-03-07 11:27 AM] Failed to create folder '/var/www/html/test': could not create folder "sftp://www.example.com/test". (Permission denied)
[2016-03-07 11:27 AM] Automatic upload completed in less than a minute: 1 item failed
Upvotes: 3
Views: 21884
Reputation: 7572
Checklist:
sudo
group then you can do sudo chown -R myusername:sudo /var/www/html/test/
. This is to make sure that it will also work for other people in the group.sudo chmod -R 755 /var/ww/html/test/
(Unfortunately I have found that in practice you sometimes need 777 permissions, but this is not desirable.)Upvotes: 3
Reputation: 22867
Prior to deleting, modifying and transferring files, you need to give them the permissions to the data group for the user who will perform the operations.
$ sudo usermod -a -G www-data your_username
$ sudo chgrp -R www-data /var/www/html
$ sudo chmod -R g+w /var/www/html
Upvotes: 4
Reputation: 1
After fixing permissions on server you need restart phpstorm. Worked for me on Ubuntu 17.10
Upvotes: -2
Reputation: 1625
The issue solved itself after restart.
PhpStorm support gave this answer: Please try to run File > Invalidate Caches/Restart > Invalidate and Restart.
If it still fails please send me idea.lof file as described here: https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files
Upvotes: 4
Reputation: 4721
You can try this :
chmod -R 777 /var/www
chgrp www-data /var/www
chown -R www-data /var/www
useradd -G {www-data} your_username
Upvotes: 5