Ubuntu 14.04 - PHP Version Upgraded from 5.5.9 to 5.6 - phpinfo still shows 5.5.9, php -v shows 5.6 - uninstalling 5.5.9??

I tried several ways to upgrade PHP on my Ubuntu 14.04 machine from 5.5.9 to 5.6. It was not easy, at least it worked like described on

Typing php -v shows

codePHP (cli) Copyright © 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright © 1999-2016, by Zend Technologiescode

looks good so far…

But phpinfo still shows codePHP Version 5.5.9-1ubuntu4.19code

How can I enforce apache to use PHP 5.6??

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Don’t know if you guys already resolved the problem, but here is how i did:

sudo a2dismod php5 sudo a2enmod php5.6 sudo service apache2 restart

As described here by michaelpporter


a2dismod and a2enmod didn’t work. I found the following solution based on the answer on

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get purge php5-common # remove and purge old PHP 5.x packages
sudo apt-get update # I had to run the update command again
sudo apt-get install libapache2-mod-php5.6

now phpinfo() shows PHP Version

So I would say it works… ;)

Please Be Advise!

The instructions above are not applicable to Ubuntu 14.04 anymore.

It doesn’t work anymore due to Ubuntu 14.04 End Of Life (Apr 2019).

The ppa maintainer has dropped support for Ubuntu 14.04, the supported releases is as follow:

  • Ubuntu 16.04 Xenial
  • Ubuntu 18.04 Bionic
  • Ubuntu 18.10 Cosmic
  • Ubuntu 19.04 Disco