Upgrade to the specific php 7.1/7.2 from php 7.0 in Ubuntu 16.04 [duplicate]

There is no official PHP 7.1 in the Ubuntu 16.04 repos.

If you want PHP 7.1, there is a version available in ppa:ondrej/php

You can install it like this:

  1. sudo add-apt-repository ppa:ondrej/php
  2. sudo apt-get update
  3. (optional) sudo apt-get remove php7.0
  4. sudo apt-get install php7.1 (from comments)

Remember that this is not an official upgrade path. The PPA is well known, and is relatively safe to use.

The PPA has co-installable packages (you can have multiple versions of PHP installed from that PPA). ~muru