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"
https://googleads.g.doubleclick.net/pagead/ads?gdpr=0&client=ca-pub-3527572573766151&output=html&h=280&slotname=1284802799&adk=2287826343&adf=3729577814&pi=t.ma~as.1284802799&w=1200&abgtt=6&fwrn=4&fwrnh=100&lmt=1727704184&rafmt=1&format=1200×280&url=https%3A%2F%2Fserverok.in%2Finstall-php-56-debian-9-plesk&fwr=0&fwrattr=true&rpe=1&resp_fmts=3&wgl=1&dt=1727704182377&bpp=7&bdt=322&idt=806&shv=r20240925&mjsv=m202409240101&ptt=9&saldr=aa&abxe=1&cookie=ID%3D7f6b03d523dc17b0%3AT%3D1727700583%3ART%3D1727703899%3AS%3DALNI_MbtvSB1WDRlqL93od_mkPjFy69uGg&gpic=UID%3D00000f155d560fe8%3AT%3D1727700583%3ART%3D1727703899%3AS%3DALNI_MZxj17CTbsHt9d0HEYnptsr8Nyb-A&eo_id_str=ID%3D2784345bb28b9855%3AT%3D1727700583%3ART%3D1727703899%3AS%3DAA-AfjaHwphDwBqcViAWW3OFW6_H&prev_fmts=0x0&nras=1&correlator=1247947866553&frm=20&pv=1&u_tz=300&u_his=1&u_h=768&u_w=1366&u_ah=728&u_aw=1366&u_cd=24&u_sd=1&adx=75&ady=781&biw=1349&bih=643&scr_x=0&scr_y=0&eid=44759876%2C44759927%2C44759842%2C31087425%2C31087430%2C42532523%2C95335246%2C95339679&oid=2&pvsid=3977622073951369&tmod=705338727&uas=0&nvt=1&ref=https%3A%2F%2Fserverok.in%2Fcategory%2Fplesk%2Fpage%2F2&fc=1920&brdim=-8%2C-8%2C-8%2C-8%2C1366%2C0%2C1382%2C744%2C1366%2C643&vis=1&rsz=%7C%7CeEbr%7C&abl=CS&pfx=0&fu=128&bc=31&bz=1.01&ifi=2&uci=a!2&btvi=1&fsb=1&dtd=1831