The current PHP ssh2 extension via PECL won't compile under PHP7.
Using a more recent version via PHP's GitHub we can make this work.
$ sudo apt-get install autoconf libssh2-1-dev
$ curl -LO https://github.com/php/pecl-networking-ssh2/archive/master.zip
$ unzip master.zip
$ cd pecl-networking-ssh2-master
$ phpize
$ ./configure
$ makeExtension will be available for use at ./modules/ssh2.so.
What is phpize? Is it command? I cannot install it on Ubuntu 16.04:
Update: run command
sudo apt-get install php-devto obtain phpize command.When you will finish steps above you will have
ssh2.sofile in foldermodules. Place it somewhere to path/usr/lib/php/20151012/as arootand add thisextension=/usr/lib/php/20151012/ssh2.soto the end of
php.inisudo nano /etc/php/7.0/fpm/php.iniand restart PHP7
sudo service php7.0-fpm restartCreate phpinfo.php somewhere on your server
It should contains "ssh2" string.