How to install php ssh2 on centos

藏色散人
Release: 2023-02-13 11:11:58
Original
3237 people have browsed it

How to install php ssh2 on centos: 1. Install ssh2 dependencies through the "yum install libssh2 libssh2-devel" command; 2. Install ssh2 through the make command; 3. Edit php.ini and add the content "extension= ssh2.so"; 4. Restart php.

How to install php ssh2 on centos

The operating environment of this article: CentOS 7.2 system, PHP7.1 version, DELL G3 computer

centos7 Install php extension-ssh2

1. Install ssh2 dependencies

yum install libssh2 libssh2-devel
Copy after login

2. Install ssh2

First download ssh2 address: http://pecl.php.net/package/ssh2 v1 .0 The above is related to 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
Copy after login

After completing make install, an address will be returned:

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

3. Edit php.ini

Add a line

extension=ssh2.so
Copy after login

4. Restart php

systemctl restart php-fpm
 
php -m | grep ssh2
Copy after login

Recommended: "centos tutorial"

The above is the detailed content of How to install php ssh2 on centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template