Guide to install PHP SSH2 module on cPanel Server
Wondering how to install PHP SSH2 module on cPanel Server? You are at the right place. Today, we will guide you with simple steps using which you can add PHP SSH2 module to your cPanel Server. This requires no prior knowledge or experience.
Let us discuss some requirements below
- cPanel/WHM installed server
- Root access to the Server on SSH
Procedure
- Login to root user of the server on SSH.
- Install package libssh2-devel on your server using the following command.
yum install libssh2-devel -y
- Install ssh2 using PECL on the server with the following commands.
/usr/local/cpanel/3rdparty/bin/pecl install ssh2
Note: PECL Installer will ask libssh2 prefix, where we will press enter button without entering anything.
- Now we need to enable the module in php.ini. Retrieve the php.ini location using the following command.
php -i | grep "Loaded Configuration File"
- Run the following command to map the extension into PHP
echo "extension=ssh2.so" >> /opt/cpanel/ea-php56/root/etc/php.ini
- Check if you have additional PHP versions on your server.
ls /opt/cpanel/ | grep ea-php
- Repeat Step #5 for other PHP version installed on your server by replacing the php.ini file location.
- Restart Apache web server.
/scripts/restartsrv_apache
- Check if SSH2 PHP module is loaded or not by using the following command.
php -i | grep ssh2
With this, we have finished the Installation of PHP SSH2 module on cPanel Server.