DevOps Blog - Nicolas Paris

Add PHP5.6 to Plesk Obsidian on Debian


Why on earth would you want to add PHP 5.6 on a Debian 10 in 2022? PHP5.6 is just so old. But still, and here's how.

First, I installed the php5.6 version on Debian 10. This example is based on a OVH VPS with the Plesk installed. I Could not use the Ondrej PPA, I'm not a Debian expert, I am more used to Ubuntu. But this works for me.

In my case, I will use the cgi of php to make it work.

wget -q -O- | sudo apt-key add -
echo "deb $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list

sudo apt update
sudo apt install php5.6-cli php5.6-common php5.6-curl php5.6-mbstring php5.6-mysql php5.6-xml php5.6-gd php5.6-dom php5.6-json php5.6-opcache php5.6-readline php5.6-xsl php5.6-bcmath php5.6-soap php5.6-cgi

We need to make it available inside Plesk as a choice in the PHP selector, here's how.

/sbin/plesk bin php_handler --add -displayname php5.6 -path /usr/bin/php-cgi5.6 -phpini /etc/php/5.6/cgi/php.ini -type cgi -id plesk-php56-gci -clipath /usr/bin/php5.6

Ressources I used:

php5.x sur Plesk
plesk add handler, doc off
php5.x sur Debian