We have already discussed about how to install and configure SSH2 extension in XAMPP in Linux System, same process will configure in your PHP.

Step 1 : Before start, we need to update and install the necessary packages for  build/install ssh2 extension

#  yum update

#  yum install  make gcc  libssh2  php-devel php-pearlibssh2-devel

Step 2 : Install ssh2 extension using pecl command for  auto detect and download once hit enter,
#  pecl install -f ssh2

downloading ssh2-0.12.tgz ...
Starting to download ssh2-0.12.tgz (26,223 bytes)
.........done: 26,223 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
libssh2 prefix? [autodetect] :
Build process completed successfully
Installing '/usr/lib64/php/modules/ssh2.so'
install ok: channel://pecl.php.net/ssh2-0.12
configuration option "php_ini" is not set to php.ini location
You should add "extension=ssh2.so" to php.ini

Step 3 : Once the package has been installed in your system, we need to configure the extension to PHP (php.ini  or ssh2.ini)
# echo "extension=ssh2.so" >  /etc/php.d/ssh2.ini


# echo "extension=ssh2.so"  > /etc/php.ini

Step 4 : Finally restart your web server
# service restart httpd.service

Now, check the module whether is configure with PHP,
# php -m | grep ssh2

Also can  check in your phpinfo();