How can I upgrade to php 7.1 from php 7.0 in ubuntu 16.04 ?
If I do a php -v
I get this message:
PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.8-0ubuntu0.16.04.3, Copyright (c) 1999-2016, by Zend Technologies
Best Answer
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:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get remove php7.0
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