Admin-Ahead Community

Linux => Control Panels => cPanel => Topic started by: rohitj on November 23, 2013, 07:44:44 pm

Title: Install PHP SSH2 Extension
Post by: rohitj 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!!!