Install PHP-SSH2 extension in cPanel

PHP SSH2 extension to be loaded into the cPanel server as this module is not available inside EasyApache.

We need to install it separately and integrate to the current configuration using below steps -

1. Download and install libssh2 from this website, http://www.libssh2.org/snapshots/
$ cd /usr/local/src
$ wget http://www.libssh2.org/snapshots/libssh2...319.tar.gz
$ tar -xzf libssh2-1.4.0-20120319.tar.gz
$ cd libssh2-*
$ ./configure
$ make all install

2. Before configuring the extension we need to know where the PHP extension dir path. Refer below command to get this -
$ php -i | grep extension_dir
/usr/local/lib/php/extensions/no-debug-non-zts-20090626

3. Then, download PECL ssh2 module from here, http://pecl.php.net/package/ssh2 and install the module:
$ cd /usr/local/lib/php/extensions/no-debug-non-zts-20090626
$ wget http://pecl.php.net/get/ssh2/
$ tar -xzf ssh2-0.11.3.tgz
$ mv ssh2-0.11.3 php-ssh2
$ cd php-ssh2
$ phpize
$ ./configure
$ make
$ make install

4. Now we need to enable the module in php.ini. Retrieve the php.ini location:
$ php -i | grep "Loaded Configuration File"
Loaded Configuration File => /usr/local/lib/php.ini

And now add extension in desired PHP.INI -
$ extension=ssh2.so

This has been done! You can check using below command -
php -m | grep ssh2

Was this answer helpful?

 Print this Article

Also Read

MySQL server is currently offline. Error: Too many connections at /usr/local/cpanel/Cpanel/Mysql.pm line 173.

phpMyAdmin and MySQL Databases in cPanel were displaying me the below error -...

How to get backup data recursively from the Amazon server?

There may be a situation where you do not have a zip utility on Amazon server so, the backup...

FATAL: Failed to download updatenow.static from server: The system cannot update the /var/cpanel/sysinfo.config file. at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 115 : upcp failed

You may come across the message "***** FATAL: Failed to download updatenow.static from server:...

The MySQL server is currently offline. Mysql::initcache() failed: The mysql server is offline.

I was getting below error while accessing MySQL Databases from cPanel though MySQL service was...

PHP extension soap must be loaded - Magento Issue

While installing the Magento on cPanel server, I got the error as 'PHP extension “soap” must be...

Powered by WHMCompleteSolution