Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Install PHP SSH2 Extension  (Read 7141 times)

0 Members and 1 Guest are viewing this topic.

rohitj

  • Guest
Install PHP SSH2 Extension
« on: November 23, 2013, 07:44:44 pm »
Install PHP SSH2 Extension

In 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 install


Now 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-ssh2


Once 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!!!