centos7 安装php扩展-ssh2

centos7 安装php扩展-ss2

1. 安装ssh2的依赖

yum install libssh2 libssh2-devel 

2. 安装ssh2

首先下载ssh2 地址:http://pecl.php.net/package/ssh2  v1.0 以上是php7相关

wget http://pecl.php.net/get/ssh2-1.1.2.tgz
tar zxvf ssh2-1.1.2.tgz
cd ssh2-1.1.2
phpize
./configure
make
make test
make install

完成make install后会返回一个地址:

[root@session113 ssh2-1.1.2]# make install
Installing shared extensions:     /usr/lib64/php/modules/

3. 编辑php.ini

添加一行

extension=ssh2.so

4. 重启php

systemctl restart php-fpm

php -m | grep ssh2

参考:

https://www.cnblogs.com/lwn007/p/8735499.html

https://blog.csdn.net/woshizhangliang999/article/details/79001686

发布了99 篇原创文章 · 获赞 52 · 访问量 29万+

猜你喜欢

转载自blog.csdn.net/weixin_39461487/article/details/86493349