A general overview of SSH2 for PHP can be found at the official Secure Shell2 reference. If you look at the requirements section, you will see that two other libraries are required for it to work. They are OpenSSL and libssh2. I explain here how to install both of these first. And then we proceed to actually install ssh2 for PHP shell connections.