Adding a PPA for PHP 7.0 Packages:

[sourcecode language=”plain”]
sudo add-apt-repository ppa:ondrej/php
[/sourcecode]

FAQ: Error sudo: add-apt-repository: command not found, For Ubuntu 14.04 you need another package:

[sourcecode language=”plain”]
apt-get install software-properties-common
[/sourcecode]

update the local package:

[sourcecode language=”plain”]
sudo apt-get update
[/sourcecode]

Install the PHP7 packages. This will upgrade all of the important PHP packages, with the exception of php5-mysql, which will be removed:

[sourcecode language=”plain”]
sudo apt-get install php7.0
[/sourcecode]

Re-add the updated PHP MySQL:

[sourcecode language=”plain”]
sudo apt-get install php7.0-mysql
[/sourcecode]

Upgrading PHP-FPM with Nginx:

[sourcecode language=”plain”]
sudo apt-get install php7.0-fpm
[/sourcecode]

Ubuntu Apache: “Module php7 does not exist”:

[sourcecode language=”plain”]
sudo apt-get install libapache2-mod-php7.0
[/sourcecode]

Configuring and Switching Versions:

[sourcecode language=”plain”]
sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
[/sourcecode]

phpmyadmin not working due to missing extensions:

[sourcecode language=”plain”]
sudo apt-get install php-mbstring php7.0-mbstring php-gettext
sudo service apache2 restart
[/sourcecode]

NOTICE: Not enabling PHP 7.0 FPM by default, To enable PHP 7.0 FPM in Apache2 do:

[sourcecode language=”plain”]
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.0-fpm
sudo service apache2 restart
[/sourcecode]