September 29, 2016 level13 No comments

Installing SSH2 on Ubuntu with PHP7

Before I had this website up and running, I needed to setup the server which was running Ubuntu 16. All was going well until I needed SSH to allow WordPress to be able to install plugins and themes and updates. This can be done over FTP but SSH is more secure. The problem was that no matter what commands I tried, and I tried googling a lot, nothing seemed to work. Until this…


and if you don’t have unzip installed:

sudo apt install unzip

now unzip it


change to the directory you have just unzipped

cd pecl-networking-ssh2-php7

install it

sudo apt install php7.0-dev

install SSH2

sudo pecl install ssh2-1.0

now to add in the extension to Apache

sudo nano /etc/php/7.0/apache2/php.ini

and add (I would suggest below the other extensions):

and finally, restart Apache:

sudo service apache2 restart

This is the list of steps I took to get it working (on Ubuntu 16.041).

Leave a Reply

Your email address will not be published. Required fields are marked *