Question
- How to add PHP 7.3 in Plesk for Debian 11?
Answer
On Debian Linux operating systems, you can install any PHP version you want by using the official PHP documentation for the purpose.
Afterwards, you can make the newly available in Plesk by registering it with the plesk bin php_handler
command-line utility.
You may follow the more detailed steps below in order to install PHP 7.3 on Debian 11:
Warning: All the instructions below are to be performed at your own will and risk. These steps are provided for demonstration purposes only and are not supported by Plesk. Depending on the operating system and the desired configuration, installation steps might differ significantly. When installing a different PHP version on the server, read the official PHP documentation on installation. It's recommended to perform the installation in a test environment before modifying the production environment.
Please follow the steps below:
1. Log into your server via SSH
2. Update repositories and upgrade packages.
# sudo apt-get update && sudo apt-get upgrade
3. Install the software-properties-common package to manage repositories.
# apt-get install software-properties-common
4. The next 4 commands below are meant to install the repository for PHP 7.3.
# apt-get -y install apt-transport-https lsb-release ca-certificates curl
# curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
# sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
# apt-get update
5. Install PHP 7.3.
# apt -y install php7.3
6. Install additional packages based on your requirements (below is an example).
# apt-get install -y php7.3-{bcmath,bz2,cli,common,curl,dev,fpm,gd,gmp,imagick,imap,intl,json,mbstring,mysql,opcache,soap,ssh2,xml,xmlrpc,zip}
7. The three commands below will enable configuration in Apache.
# a2enmod proxy_fcgi setenvif
# a2enconf php7.3-fpm
# systemctl reload apache2
8. Register the PHP into Plesk handler.
# plesk bin php_handler --add -displayname php73-fpm-custom -path /usr/sbin/php-fpm7.3 -phpini /etc/php/7.3/fpm/php.ini -type fpm -id php73-fpm-custom -clipath /usr/bin/php -service php7.3-fpm -poold /etc/php/7.3/fpm/pool.d