.
3ss.cn

centos怎么样安装php ssh2

centos安装php ssh2的方法:1、安装ssh2的依赖;2、安装ssh2;3、编辑php.ini,添加内容“extension=ssh2.so”;4、重启php即可。

centos7 安装php扩展-ssh2

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
赞(0)
未经允许不得转载:互联学术 » centos怎么样安装php ssh2

评论 抢沙发