How to configure PHPStorm 7 to keep your SSH sessions alive

Many people have reported that there is no way to keep your SSH session alive with PHPStorm when working on a remote server.

Actually, there is. You will need a PHPStorm7 to do this, though.

Alright, correcting this post now, because I was ENTIRELY wrong. It turned out I did one thing in the meantime that caused this to work and then I confused it with Start SSH Session thing.

It's even easier. All you need to do is to basically click on Tools -> Deployment -> Browse Remote Host. It should open a panel on the right with a list of files on your remote host. You can hide this panel (it will still work!).

If you haven't already, you will have to do two things for this to work:

  • Configure your Deployment Server under File -> Settings -> Project Settings -> Deployment.
  • Configure your SSH Terminal settings under File -> Settings -> SSH Terminal (chose the server you configured in the previous step in the "Deployment Server" drop down)

Quick Way To Keep Connection Alive - Screenshot

All set! Enjoy!

Go to Tools -> Start SSH Session.

It will open a built-in terminal at the bottom of your IDE window and well... you will have an active SSH connection :). It was intended to be used for executing SSH commands from within PHPStorm, but the side effect is that... it keeps an active connection!

Still a bit of a workaround, but I guess much better than just keeping PHPStorm uploading a small file in the background as some people have suggested online ;).

EDIT: For some reason, it works perfectly on one project, but it doesn't for another one. Both use the same server, so it's a bit mysterious. Once I find the reason of this - I will update this post. So if it doesn't work for you - it may be the same case!

P.S. To make this easier for me - let me know if it worked for you or not!


comments powered by Disqus