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!

3 Answers 3


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.


In case anyone finds this...

I've since done,

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get dist-upgrade
sudo reboot

Seemed to do the trick.

I had to install some modules which were missing from the new version but other than that, all good.

  • Was phpfpm involved? I smell a long-running php process that wasn't restarted after the upgrade. Jan 25, 2017 at 23:36
  • 1
    @DylanMartin The problem was that Steve wrote "apt-get install php7.1" when that is not a package. Just installing php7.0 will install the newest version avaible
    – Orphans
    Jan 26, 2017 at 7:26
  • 2
    php7.1 is definitely a package, I installed it. See here, or here
    – Steve
    Jan 26, 2017 at 13:23
  • phpfpm wasn't invloved as far as I know, not sure what was going on. All I know is it works now.
    – Steve
    Jan 26, 2017 at 13:25
  • @Steve Oh, I thought about php7.0.12. Thanks for making it clear to me
    – Orphans
    Jan 27, 2017 at 8:23

You might have to change path to your new php in your sites-available or apache config. For nginx I have following:

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;                     

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .