On ubuntu 16.04 you will install all php 5.6 neded.
apt-get update && apt-get upgrade -y
apt-get install -y language-pack-en-base
LC_ALL=en_US.UTF-8 add-apt-repository ppandrej/php
apt-get update && apt-get upgrade -y
apt-get install lsb-release nscd curl php5.6 php5.6-mysql php5.6-cli php5.6-curl unzip -y && apt-get install php5.6-mcrypt && php5.6enmod mcrypt
service apache2 restart
apt-get update && apt-get upgrade -y
apt-get install -y language-pack-en-base
LC_ALL=en_US.UTF-8 add-apt-repository ppandrej/php
apt-get update && apt-get upgrade -y
apt-get install lsb-release nscd curl php5.6 php5.6-mysql php5.6-cli php5.6-curl unzip -y && apt-get install php5.6-mcrypt && php5.6enmod mcrypt
service apache2 restart