To Install PHP 5.6 on Ubuntu just follow the command one by one bellow.
apt-get update apt-get install software-properties-common add-apt-repository ppa:ondrej/php apt-key del 4F4EA0AAE5267A6C apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C apt-get install apache2 php5.6 php5.6-cgi php5.6-curl php5.6-gd php5.6-intl php5.6-mysql php5.6-json php5.6-bz2 php5.6-mcrypt php5.6-xmlrpc php5.6-xsl php5.6-bcmath php5.6-mbstring php5.6-soap php5.6-xml php5.6-zip service apache2 restart
This doesn’t work even:
E: Unable to locate package php5.6
E: Couldn’t find any package by regex ‘php5.6’
E: Unable to locate package php5.6-cgi
E: Couldn’t find any package by regex ‘php5.6-cgi’
E: Unable to locate package php5.6-curl
E: Couldn’t find any package by regex ‘php5.6-curl’
E: Unable to locate package php5.6-gd
E: Couldn’t find any package by regex ‘php5.6-gd’
E: Unable to locate package php5.6-intl
E: Couldn’t find any package by regex ‘php5.6-intl’
E: Unable to locate package php5.6-mysql
E: Couldn’t find any package by regex ‘php5.6-mysql’
E: Unable to locate package php5.6-json
E: Couldn’t find any package by regex ‘php5.6-json’
E: Unable to locate package php5.6-bz2
E: Couldn’t find any package by regex ‘php5.6-bz2’
E: Unable to locate package php5.6-mcrypt
E: Couldn’t find any package by regex ‘php5.6-mcrypt’
E: Unable to locate package php5.6-xmlrpc
E: Couldn’t find any package by regex ‘php5.6-xmlrpc’
E: Unable to locate package php5.6-xsl
E: Couldn’t find any package by regex ‘php5.6-xsl’
E: Unable to locate package php5.6-bcmath
E: Couldn’t find any package by regex ‘php5.6-bcmath’
E: Unable to locate package php5.6-mbstring
E: Couldn’t find any package by regex ‘php5.6-mbstring’
E: Unable to locate package php5.6-soap
E: Couldn’t find any package by regex ‘php5.6-soap’
E: Unable to locate package php5.6-xml
E: Couldn’t find any package by regex ‘php5.6-xml’
E: Unable to locate package php5.6-zip
E: Couldn’t find any package by regex ‘php5.6-zip’