How to install PHP ssh2 module in Cpanel Server

PHP ssh2 module allows you to connect to SSH servers. On Cpanel servers, this module is not available under EasyApache. You need to install using PECL. The PECL module installer in WHM does not list this module. The module is available to download from

https://pecl.php.net/package/ssh2

To install it, log in to the Cpanel server as SSH user root or login to WHM as user root, go to Terminal.

Run the command

This will install ssh2 module for PHP 7.4.

For PHP 8.0, you can run

You can also specify the full download URL for the SSH2 module like

If you need to install SSH module for another PHP version, change ea-php74 to whatever PHP version you are using. Make sure you select the appropriate ssh2 module version that works with the PHP version you are using.

After installing, restart Apache with

To verify the ssh2 module is installed, create a PHP file with phpinfo() function, you will see.

Cpanel php-ssh2 module phpinfo

Back to Cpanel Server

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *