When editing a file with PHPStorm, the group is changed from www-data to my local user. I've added my local user to the www-data group, and if I edit the file with gedit/vim/etc. the group stays as www-data.

I suspect PHPStorm must be running as a different user, but when I check ps, it shows as my local user. What would cause this program to alter the group of a file it's editing?


What causes this is most likely is that the original file is backed up by the editor and then the new file is written so it gets the current group id of the user. The editor would have to explicitly reset the group to the original group.

You could try to use newgrp to change the group of the user doing the editing before starting PHPStorm:

newgrp www-data 
| improve this answer | |
  • 1
    It looks like this is in fact the case. PhpStorm has a feature called 'safe write' doing just this! Thanks. – Ryre Jan 20 '14 at 21:34
  • Or disable the "safe write" option as detailed here stackoverflow.com/questions/27248933/… – joesk Sep 24 '16 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.