update php 5.5.9 to 5.6 in an Ubuntu

This work for perfectly for me. Add the right PPA first, by doing the following

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl
php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip
Disable php 5.5.3 or 5.5.9 module

a2dismod php5
Enable the just installed php5.6 module

a2enmod php5.6
Finally, you restart your apache

sudo service apache restart