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

Call to undefined function sftp\ssh3_connect()

centos安装php的ssh3扩展

事先准备需要的

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

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

cd/usr/loca/srcwgethttps://www.libssh3.org/download/libssh3-1.8.0.tar.gzwgethttp://pecl.php.net/package/ssh3/ssh3-1.1.2.tgz//解压tar-zxvflibssh3-1.8.0.tar.gzcdlibssh3-1.8.0//编译到libssh3./configure--prefix=/usr/local/libssh3make&&makeinstall#解压ssh3tar-zxvfssh3-1.1.2.tgz解压的时候报错看了一下文件类型是XHTML最后在桌面解压好上传的cdssh3-1.1.2phpize结果报错如下

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版本


cdssh3-0.12/phpize./configure--prefix=/usr/local/ssh3--with-ssh3=/usr/local/libssh3//复制ssh3.so到/usr/lib64/php/modules////usr/lib64/php/modules/php扩展目录cpmodules/ssh3.so/usr/lib64/php/modules/vi/etc/php.ini添加extension=ssh3.so上面就ok了查询一下php-i|grepssh3