Cannot Save Files "C:\Windows\System32\drivers\etc\hosts___jb_bak___ (Access is denied)"

I'm getting a strange error in PHPStorm 9 on Windows 10:

     Cannot Save Files
     Following errors occured on attempt to save files:
     C:\Windows\System32\drivers\etc\hosts___jb_bak___ (Access is denied)

Windows 10 and PHPStorm 9 are both new on this machine.

Additionally, I don't know if any plugins might be contributing.

It happens:

  • as soon as I save the hosts file
  • when I save other files
  • every time I focus another application
  • even after the hosts file as been closed

The only way to stop it is to restart PHPStorm.


Comment actions Permalink

Do you try editing hosts file in PHPStorm? Editing this file requires elevated permissions, you won't be able to do this unless PHPStorm is run as administrator. See for some hints

Comment actions Permalink

Thanks Elena, I figured this after posting :)

What's with PHPStorm hanging on to the files though?

Comment actions Permalink

make sure to close the file in PHPStorm and restart - is the error still there? Please invalidate caches (File/Invalidate caches, restart) then, to make sure this file is not in VFS caches

Comment actions Permalink

As mentioned, it stops after a restart, but I was mentioning this as it's undesirable behaviour before that.


Please sign in to leave a comment.