XAMPP安装SSH2扩展
wget http://pecl.php.net/get/ssh2-0.11.3.tgz
tar -xf ssh2-0.11.3.tgz
cd ssh2-0.11.3/
/opt/lampp/bin/phpize
报错
cannot find autoconf. please check your autoconf installation Xampp in CentOS
需要安装
yum install autoconf
再次
/opt/lampp/bin/phpize
./configure --with-php-config=/opt/lampp/bin/php-config
报错,缺少libssh2
需要安装
yum install libssh2-devel
再次
./configure --with-php-config=/opt/lampp/bin/php-config
报错,缺少c
需要安装
yum install gcc
再次
./configure --with-php-config=/opt/lampp/bin/php-config
就没问题了
make
make install
cd /opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/
ls -al ssh*
vi /opt/lampp/etc/php.ini
增加
extension=”ssh2.so”
重启
/opt/lampp/lampp restart
/opt/lampp/bin/php -i | grep ssh2
[root@VM_68_206_centos ~]# /opt/lampp/bin/php -i | grep ssh2
Registered PHP Streams => https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip, ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp
ssh2
libssh2 version => 1.4.3
banner => SSH-2.0-libssh2_1.4.3
看到这样就没问题了。