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
$ make
Extension will be available for use at ./modules/ssh2.so
.
I have done the following to activate the extension on php7.0 CLI environment.
First copy (or move) the compiled extension along the other php's extensions.
$ sudo cp ./modules/ssh2.so /usr/lib/php/20151012/ssh2.so
Then create an ini file
/etc/php/7.0/mods-available/ssh2.ini
with the following content:Now create a symlink to activate the extension (this is what
php5enmod
does in php5 environements).$ sudo ln -s /etc/php/7.0/mods-available/ssh2.ini /etc/php/7.0/cli/conf.d/20-ssh2.ini
That's it. You can check activated modules with the following command:
Thanks a lot for the info, I needed ssh2 extension for a Phing project.