PHP 安装SSH2扩展 Centos

http://www.libssh2.org

wget https://www.libssh2.org/download/libssh2-1.8.0.tar.gz

安装

tar -zxvf libssh2-1.8.0.tar.gz
cd libssh2-1.8.0
./configure --prefix=/usr/local/libssh2
make && make install

风.foxiswho
http://pecl.php.net/package/ssh2

wget http://pecl.php.net/get/ssh2-1.1.2.tgz

安装 你的PHP 必须先安装完成

tar zxvf ssh2-1.1.2.tgz
cd ssh2-1.1.2
/www/lanmps/php/bin/phpize
./configure --with-ssh2=/usr/local/libssh2 --with-php-config=/www/lanmps/php/bin/php-config
make && make install

说明
/www/lanmps/php/bin/phpize 为php安装目录下bin/phpize文件
/www/lanmps/php/bin/php-config 为php安装目录下bin/php-config文件

安装完成后,会直接打印输出 你所安装的 目录是多少

Installing shared extensions:  /www/lanmps/php/lib/php/extensions/no-debug-non-zts-xxxxxxxx/

修改php.ini文件
加入

extension=ssh2.so

参考 http://blog.csdn.net/github_26672553/article/details/50407639
首发 http://www.foxwho.com/article/162
同步 foxwho(神秘狐)的领地 http://www.foxwho.com