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


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/
tar -xzvf ssh2-1.1.tgz
cd ssh2-1.1

Build the extension

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

Update php.ini

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

That's it!


Latest Updates