Upgrade to PHP 5.6 on Ubuntu 14.04
You can now upgrade to PHP 5.6 very easily thanks to a PPA.
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
The line below can be edited to exclude modules that you don’t require:
sudo apt-get -y install php5.6 php5.6-fpm 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
This process will install Apache, just ignore it if you use nginx.
You’ll now need to update your PHP socket used in your nginx configuration files, then remember to restart nginx.
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
service php5.6-fpm restart
and service nginx restart