Install PHP 8.0 on Debian 9 Plesk Server

Install PHP 8.0 on Debian 9 Plesk Server

To install PHP 8 on Debian 9 Plesk Server, add repository

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

Install PHP 8 with apt

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

Enable PHP 8 as default CLI

update-alternatives --config php

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

Enable PHP 8 in Plesk

plesk bin php_handler --add -displayname "8.0 by" -path /usr/bin/php-cgi8.0 -clipath /usr/bin/php8.0 -phpini /etc/php/8.0/cgi/etc/php.ini -type cgi -id "php80-cgi"
plesk bin php_handler --add -displayname "8.0 by" -path /usr/bin/php-cgi8.0 -clipath /usr/bin/php8.0 -phpini /etc/php/8.0/cgi/etc/php.ini -type fastcgi -id "php80-fastcgi"
plesk bin php_handler --add -displayname "8.0 by" -path /usr/sbin/php-fpm8.0 -clipath /usr/bin/php8.0 -phpini /etc/php/8.0/fpm/etc/php.ini -type fpm -service php8.0-fpm -poold /etc/php/8.0/fpm/pool.d -id "php80-fpm"
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.