Ubuntu Linux apt-get php7

Fig.01: Configure a PPA for PHP 7.0 packages

Fig.01: Configure a PPA for PHP 7.0 packages

First add a PPA as follows:
$ sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
Sample outputs:

Co-installable PHP versions: PHP 5.6, PHP 7.0 and batteries included.
 
You can get more information about the packages at https://deb.sury.org
 
For PHP 5.6 use: ppa:ondrej/php5-5.6
For PHP 5.5 use: ppa:ondrej/php5
For PHP 5.4 use: ppa:ondrej/php5-oldstable
 
BUGS&FEATURES: This PPA now has a issue tracker: https://deb.sury.org/pages/bugreporting.html
 
PLEASE READ: If you like my work and want to give me a little motivation, please consider donating: https://deb.sury.org/pages/donate.html
 
WARNING: add-apt-repository is broken with non-UTF-8 locales, see https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:
 
# apt-get install -y language-pack-en-base
# LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
 More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it
 
gpg: keyring `/tmp/tmpgx6k2u66/secring.gpg' created
gpg: keyring `/tmp/tmpgx6k2u66/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpgx6k2u66/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

Activate repos, enter:
$ sudo apt-get update
$ sudo apt-get upgrade

To install PHP 7, enter:

$ sudo apt-get install php7.0 php7.0-cli php7.0-fpm php7.0-gd php7.0-json php7.0-mysql php7.0-readline
Sample outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  fontconfig-config fonts-dejavu-core libapparmor1 libfontconfig1 libfreetype6
  libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libqdbm14 libssl1.0.2
  libsystemd-daemon0 libtiff5 libvpx1 libx11-6 libx11-data libxau6 libxcb1
  libxdmcp6 libxpm4 php-common php7.0-common php7.0-opcache
Suggested packages:
  libgd-tools php-pear php-user-cache
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core libapparmor1 libfontconfig1 libfreetype6
  libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libqdbm14 libssl1.0.2
  libsystemd-daemon0 libtiff5 libvpx1 libx11-6 libx11-data libxau6 libxcb1
  libxdmcp6 libxpm4 php-common php7.0 php7.0-cli php7.0-common php7.0-fpm
  php7.0-gd php7.0-json php7.0-mysql php7.0-opcache php7.0-readline
0 upgraded, 30 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,270 B/9,528 kB of archives.
After this operation, 36.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main php7.0 all 7.0.3-3+deb.sury.org~trusty+1 [1,270 B]
Fetched 1,270 B in 0s (5,523 B/s)   
Preconfiguring packages ...
Selecting previously unselected package libssl1.0.2:amd64.
(Reading database ... 15996 files and directories currently installed.)
Preparing to unpack .../libssl1.0.2_1.0.2f-2+deb.sury.org~trusty+1_amd64.deb ...
.....
..
...
update-alternatives: using /usr/bin/phar7.0 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.0 to provide /usr/bin/phar.phar (phar.phar) in auto mode
 
Creating config file /etc/php/7.0/cli/php.ini with new version
Setting up php7.0-fpm (7.0.3-3+deb.sury.org~trusty+1) ...
 
Creating config file /etc/php/7.0/fpm/php.ini with new version
Setting up php7.0-gd (7.0.3-3+deb.sury.org~trusty+1) ...
 
Creating config file /etc/php/mods-available/gd.ini with new version
Setting up php7.0-mysql (7.0.3-3+deb.sury.org~trusty+1) ...
 
Creating config file /etc/php/mods-available/mysqli.ini with new version
 
Creating config file /etc/php/mods-available/pdo_mysql.ini with new version
Processing triggers for ureadahead (0.100.0-16) ...
Setting up php7.0 (7.0.3-3+deb.sury.org~trusty+1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for php7.0-fpm (7.0.3-3+deb.sury.org~trusty+1) ...
 * Restarting PHP 7.0 FastCGI Process Manager php-fpm7.0

Examples and usage: How to install PHP 7 on Ubuntu Linux 14.04 LTS