ENABLE PHP 5.6 ON UBUNTU 18.04 / PLESK 17.8

Obviously, in an ideal world EVERYONE would move to PHP 7.1 (php 7.0 is already end of life).  For Magento customers this is a win win situation. PHP 7x is significantly quicker than php 5.6 and more secure.  Magento have released patches that enabled M1 sites to run on php 7.1.  However, extension providers have shown little willingness to follow suite and this is where upgrade wagon hits problems.  Most clients are weighing up the costs of fixing this against shiny new Magento 2 sites.  So realistically php 5.6 will be needed for a some time to come. 

Fortunately, thanks to  Ondřej Surý for maintaining a PPA of most the popular PHP versions and because of Plesk's flexibility, it is relatively straight forward to add this support.

The following presumes you have 18.04 and Plesk 17.8 install already.


sudo add-apt-repository ppa:ondrej/php

sudo apt-get install php5.6

Most php application will require additional modules eg

sudo apt-get install php5.6-igbinary php5.6-mbstring php5.6-mcrypt php5.6-soap php5.6-redis php5.6-intl php5.6-mcrypt php5.6-mysqli php5.6-xml

As fpm is the most efficient way to run php we will need to install this also.

sudo apt-get install php5.6-fpm

The CGI is optional

sudo apt-get install php5.6-cgi

If you wish to set a specific version of php as the default CLI you can run 


sudo update-alternatives --config php

Finally we need to tell Plesk about this.

/usr/local/psa/bin/php_handler --add -displayname fpm-56 -path /usr/bin/php-cgi5.6 -phpini /etc/php/5.6/fpm/php.ini -type fpm -clipath /usr/bin/php5.6 -poold /etc/php/5.6/fpm/pool.d -service php5.6-fpm


If you now reload your Plesk php settings you will see the new handler in place.