Call to undefined function ssh2_connect();安装ssh2
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Call to undefined function ssh2_connect();安装ssh2相关的知识,希望对你有一定的参考价值。
博客原文地址https://xgs888.top/post/view?id=58
Call to undefined function sftp\ssh2_connect()
centos安装php的ssh2扩展
事先准备需要的
libssh2 下载 wget https://www.libssh2.org/download/libssh2-1.8.0.tar.gz
ssh2下载 wget wget http://pecl.php.net/package/ssh2/ssh2-1.1.2.tgz
cd /usr/loca/src wget https://www.libssh2.org/download/libssh2-1.8.0.tar.gzwget http://pecl.php.net/package/ssh2/ssh2-1.1.2.tgz //解压 tar -zxvf libssh2-1.8.0.tar.gz cd libssh2-1.8.0 //编译到libssh2 ./configure --prefix=/usr/local/libssh2 make && make install #解压ssh2 tar -zxvf ssh2-1.1.2.tgz 解压的时候报错看了一下文件类型是Xhtml 最后在桌面解压好上传的 cd ssh2-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/ssh2 --with-ssh2=/usr/local/libssh2
结果都是报错,上官网看了一下,原来是ssh2-1.0yi以上版本是PHP7.0
下载0.12版本
cd ssh2-0.12/ phpize ./configure --prefix=/usr/local/ssh2 --with-ssh2=/usr/local/libssh2 //复制ssh2.so 到 /usr/lib64/php/modules/ ///usr/lib64/php/modules/ php扩展目录 cp modules/ssh2.so /usr/lib64/php/modules/ vi /etc/php.ini 添加 extension=ssh2.so 上面就ok了 查询一下 php -i|grep ssh2
以上是关于Call to undefined function ssh2_connect();安装ssh2的主要内容,如果未能解决你的问题,请参考以下文章
Fatal error: Call to undefined function oci_connect()
Call to undefined function ThinkC()
BadMethodCallException : Call to undefined method AppModelsArticle::setContainer()
ThinkPHP出现Call to undefined function bcadd怎么解决