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
# 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
or
# echo "extension=ssh2.so" > /etc/php.ini
or
# 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
ssh2
Also can check in your phpinfo();
There appears to be a space missing in the yum install line. It should read: yum install make gcc libssh2 php-devel php-pear libssh2-devel
You have a typo in the install line which makes the process fail upon C-P
very nice thanks, I had this error : checking for ssh2 files in default path... not found configure: error: The required libssh2 library was not found. but I found a solution on stack overflow question id 561024 , I can not write a link here as it says , spam detected