Php – Upgrade from PHP 7.0 to 7.1 on Ubuntu 16.04 not working

PHPubuntu-16.04

I am sucessfully running 7.0 and would like to upgrade to 7.1.

So far I've done the following,

sudo service apache2 stop
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php7.1 php7.1-common
sudo a2enmod php7.1
sudo service apache2 start

Now, php -v gives me 7.1.1 but phpinfo() is saying 7.0.15

What am I missing, is there a config file I need to change somewhere?

Thanks for any help!

Best Answer

This might be also that you have installed your php7.1 but the php7.0 mod is still enabled.

In the cli if you run php -v you have the correct version 7.1 but in the phpinfo() you will see php7.0. Disable php 7.0 with sudo a2dismod php7.0 and you will have 7.1 working properly.