Install SSH2 Extension for PHP 7 on CentOS 7

Install gcc, php71w-devel, libssh2 and libssh2-devel on CentOS 7
# yum install gcc php71w-devel libssh2 libssh2-devel

Download php7 pecl-networking-ssh2
# wget https://github.com/Sean-Der/pecl-networking-ssh2/archive/php7.zip

Unzip and Change folder
# unzip php7.zip
# cd pecl-networking-ssh2-php7

Building environment for SSH2 extension
# phpize

# ./configure

Make SSH2 extension make sure build success
# make

Install SSH2 extension
# make install

Write SSH2 extension in PHP 7 extension directory
# vi /etc/php.d/ssh2.ini
extension=ssh2.so

Restart NGINX server and php-fpm
# systemctl restart nginx
# systemctl restart php-fpm

SSH2 PHP7 CentOS7

SSH2 module enabled in PHP 7
# php -m
[PHP Modules]
apc
apcu
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch