Install PHP version 5.6
In order to install PHP version 5.6, first, open your Ubuntu Terminal and enter the following command in order to add the Ondrej PHP repository to your Ubuntu.
$ sudo add-apt-repository ppa:ondrej/php
This repository contains all the released versions of PHP till date.