Install php extensions in ubuntu 16.04

Solution 1:

Ok finding in a lot of blogs and aswer, the obviously answer is add suffix in php, then for install php5.6 or before add this.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php7.0   # for PHP 7.0
sudo apt-get install php5.6   # for PHP 5.6
sudo apt-get install php5.5   # for PHP 5.5

later of this you need install extension with the following commands

if you install php 5.6 you need add 5.6 to php, for example

sudo apt-get install php5.6-gd php5.6-mysql php5.6-dom php5.6-cli php5.6-json php5.6-common php5.6-mbstring php5.6-opcache php5.6-readline

etc . or otherwise if you make php-gd you install gd for php7, and thanks to @elder-geek for add links

Solution 2:

It's entirely possible that I am misunderstanding you entirely but if what you are looking for is available for Xenial (16.04) in the PPA you reference, it can be found listed here.

To enable GD-support configure PHP --with-gd[=DIR] , where DIR is the GD base install directory. To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option --with-gd . GD library requires libpng and libjpeg to compile.

There's an alphabetical list of extensions on this page

There's also a list of deprecated and experimental extension to be found here.

You can also obtain the Current Stable PHP 5.6.23 via download