Ubuntu install latest PHP7 version

Ubuntu has many outdated packages.

That’s why people heavily use ‚external’ repositories.

Latest version of PHP at the time of writing is 7.0 even though 7.1.2 has been released over a month ago.

7.1 has a couple of interesting features: http://php.net/manual/en/migration71.new-features.php

To install this versin you will have to perform 4 steps:

1. Add repository

The ppa:ondrej repo is recommended:

2. Install new PHP

3. Remove old PHP

This should actually also.. update any existing packages you might have installed like php-curl.

4. Activate new PHP in Apache

To do this execute:

5. Verify

With a simple command: