Sep 5, 2018 · 1 min read
Post is a couple years old but ideally this will still help someone. I was able to get past the version error by setting the preferred state to ‘alpha’ on Redhat 7 with php 7.1.8 from scl. (The alpha packages probably weren’t in the pecl repo at the time of this post.)
Steps (Note: I already had the libssh2 package installed):
sudo yum install -y libssh2-devel rh-php71-php-devel gcc
sudo pecl config-set preferred_state alpha
sudo pecl install ssh2
…
Build process completed successfully
Installing ‘/opt/rh/rh-php71/root/usr/lib64/php/modules/ssh2.so’
install ok: channel://pecl.php.net/ssh2–1.1.2
configuration option “php_ini” is not set to php.ini location
You should add “extension=ssh2.so” to php.ini