Install PHP 5.6 on Debian 9 Plesk Server

To install PHP 5.6 on Debian 9 Plesk Server, add sury.org repository

apt install apt-transport-https lsb-release ca-certificates -y
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list

Install PHP 5.6 with apt

apt-get update
apt-get install php5.6 php5.6-fpm php5.6-cgi php5.6-mysql php5.6-xsl php5.6-xml php5.6-tidy php5.6-recode php5.6-mcrypt php5.6-mbstring php5.6-intl php5.6-gd php5.6-curl php5.6-json php5.6-imagick php5.6-bcmath php5.6-readline php5.6-sqlite3

Optional: Enable PHP 5.6 as default CLI

update-alternatives --config php

This will show all available PHP version, select the default version for command line.

Enable PHP 5.6 in Plesk

plesk bin php_handler --add -displayname "5.6 by sury.org" -path /usr/bin/php-cgi5.6 -clipath /usr/bin/php5.6 -phpini /etc/php/5.6/cgi/etc/php.ini -type cgi -id "php56-cgi"
plesk bin php_handler --add -displayname "5.6 by sury.org" -path /usr/bin/php-cgi5.6 -clipath /usr/bin/php5.6 -phpini /etc/php/5.6/cgi/etc/php.ini -type fastcgi -id "php56-fastcgi"
plesk bin php_handler --add -displayname "5.6 by sury.org" -path /usr/sbin/php-fpm5.6 -clipath /usr/bin/php5.6 -phpini /etc/php/5.6/fpm/etc/php.ini -type fpm -service php5.6-fpm -poold /etc/php/5.6/fpm/pool.d -id "php56-fpm"

Comments

One response to “Install PHP 5.6 on Debian 9 Plesk Server”

  1. Greg Avatar
    Greg

    It works!!! Thank you so much brother! You saved me from reinstalling my websites and essentially downgrading my OS.

Leave a Reply

Your email address will not be published. Required fields are marked *