Ubuntu 16.04 LTS – How to install ssh2 php7 extension

How to install ssh2 php7 extension. When I tried to install ssh2 php extension with php7 I recieve error pecl/ssh2 requires PHP (version >= 4.0.0, version <= 6.0.0), installed version is 7.0.0RC4.

Step 1 – Update repositories.

root@mail:/# apt-get update
root@mail:/# apt-get upgrade

Step 2 – Install the packages with the following commands.

root@mail:/# apt-get install php libapache2-mod-php php-mcrypt php-mysql
root@mail:/# apt-get install php-cli
root@mail:/# apt-get install apache2-utils
root@mail:/# apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0
root@mail:/# apt-get install libssh2
root@mail:/# apt-get install curl libcurl3 libcurl3-dev
root@mail:/# apt-get install libssh2–1-dev libssh2–1
root@mail:/# apt-get install autoconfig uzip

Step 3 – You have to Download the source from lib ssh2 official site and install.

root@mail:/# wget https://github.com/Sean-Der/pecl-networking-ssh2/archive/php7.zip

Step 4 – Unzip the zip file.

root@mail:/# uzip php7.zip

Step 5 – Navigate to php folder.

root@mail:/# cd pecl-networking-ssh2-php7

Step 6 – Prepare build environment for this extension using phpize. It will create all required file and folder structure and configure file for our extension with this command phpize .

Step 7 – Then check configuration with this command ./configure .

Step 8 – Make our extension using with this command sudo make .

Step 9 – Make test with this command sudo make .

Step 9 – Check php version with this command php -v.

Leave a Reply

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

*
*
Website