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@94ipcom 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
转载请注明:IT运维空间 » PHP » centos怎么安装php扩展ssh2
发表评论