Install PHP SSH2 ExtensionIn order to connect to your server from php script, you have to enable ssh2 extension in php.
Steps to Install PHP SSH2 Extension
1. First of all you need to install libssh2.
Download libssh2 from wget
http://www.libssh2.org/snapshots/libssh2-1.4.4-20131123.tar.gz, untar it.
Install it using the following commands.
./configure
make
make installNow download the pecl-ssh2 installer from
http://pecl.php.net/wget http://pecl.php.net/get/ssh2-0.12.tgz
cd ssh2-0.12.tgz
tar -zxvf ssh2-0.12.tgz
cd ssh2-0.12
./configure --with-ssh2Once completed copy ssh2.so to your extension_dir as specified in php.ini.
grep extension_dir /usr/local/php52/lib/php.ini
Add the extension to your php.ini
extension=ssh2.so
Save the file & Restart httpd.
service httpd restart
Done!!!