Call to undefined function ssh2_connect();安装ssh2
更新:HHH   时间:2023-1-7


博客原文地址https://xgs888.top/post/view?id=58

Call to undefined function sftp\ssh3_connect()

centos安装php的ssh3扩展

事先准备需要的

 libssh3 下载  wget https://www.libssh3.org/download/libssh3-1.8.0.tar.gz

ssh3下载 wget  wget http://pecl.php.net/package/ssh3/ssh3-1.1.2.tgz

cd /usr/loca/src
wget https://www.libssh3.org/download/libssh3-1.8.0.tar.gzwget http://pecl.php.net/package/ssh3/ssh3-1.1.2.tgz 

//解压
 tar -zxvf libssh3-1.8.0.tar.gz
 
 cd libssh3-1.8.0
 //编译到libssh3
 ./configure --prefix=/usr/local/libssh3
 
 make && make install
 
 
 
 
 #解压ssh3
 tar -zxvf ssh3-1.1.2.tgz   解压的时候报错看了一下文件类型是XHTML 最后在桌面解压好上传的
 cd ssh3-1.1.2
 phpize 结果报错如下

Can't find PHP headers in /usr/include/php The php-devel package is required for use of this command

直接安装php-dev

yum install php55w-del ;//PHP版本是5.5的

执行phpize

./configure --prefix=/usr/local/ssh3 --with-ssh3=/usr/local/libssh3

结果都是报错,上官网看了一下,原来是ssh3-1.0yi以上版本是PHP7.0




下载0.12版本


cd ssh3-0.12/
phpize
./configure --prefix=/usr/local/ssh3 --with-ssh3=/usr/local/libssh3


//复制ssh3.so 到 /usr/lib64/php/modules/
///usr/lib64/php/modules/ php扩展目录
 cp modules/ssh3.so /usr/lib64/php/modules/
 
 vi /etc/php.ini
 添加 extension=ssh3.so
 
 上面就ok了
 查询一下 php -i|grep ssh3




返回web开发教程...