Ubuntu 14.04: problems upgrading php to 5.6 using ppa:ondrej

You are mixing different PPAs and versions and commands in incompatible way, let's break it down:

  1. libapache2-mod-php5.6 is present in ppa:ondrej/php and this is really the PPA you want to be using

  2. phpdismod is a command for disabling PHP extensions, and not to manage Apache2 modules, you need a2dismod for that

  3. The PHP Apache2 module in ppa:ondrej/php5-5.6 is named libapache2-mod-php5

So the correct would be:

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 install libapache2-mod-php5.6

If you don't uninstall php5-* packages first, you need to disable the php5 module and enable php5.6 module:

sudo a2dismod php5
sudo a2enmod php5.6

And optionally add Apache2 repository:

sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get dist-upgrade

There's a migrationg guide available for PPA packages.