Installing ssh2 extension for PHP on DirectAdmin server Jun 21, 2017

PHP SSH2

Installation of php-ssh2 on DirectAdmin is very simple. Here is how I install it, please note that I use DirectAdmin 1.51.4, CentOS 7x64, PHP 7.0 FPM on Vultr server.

Pre-install requirements

On CentOS, php-ssh2 requires libssh2-devel, so we install it

yum install libssh2-devel

Install PHP SSH2

As of php 7, we need latest ssh2 package, let download it

cd /usr/local/src/
wget https://pecl.php.net/get/ssh2-1.1.tgz
tar -xzvf ssh2-1.1.tgz
cd ssh2-1.1

Build the extension

/usr/local/php70/bin/phpize
./configure --with-php-config=/usr/local/php70/bin/php-config
make && make install

Update php.ini

just add extension=ssh2.so to your php.ini file, then restart Apache/PHP-FPM

That's it!

Advertisement

Latest Updates