Question
How to add a custom PHP versions 7.2 or 7.3 in Plesk running on Ubuntu 22?
Answer
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.
On Linux systems, you can install any PHP version you need and then make it available in Plesk by registering it with the plesk bin php_handler
command-line utility.
-
Example for 7.2 (for 7.3 just change the version number):
1. Install the software-properties-common package to manage repositories:
# apt-get install software-properties-common
2. Add PPA repository:
# add-apt-repository ppa:ondrej/php
3. Install PHP 7.2:
# apt -y install php7.2
4. Install necessary PHP modules, here's an example:
# apt-get install -y php7.2-{bcmath,bz2,cli,common,curl,dev,fpm,gd,gmp,imagick,imap,intl,json,mbstring,mysql,opcache,soap,ssh2,xml,xmlrpc,zip}
5. Register PHP handler in Plesk:
# plesk bin php_handler --add -displayname php72-fpm-custom -path /usr/sbin/php-fpm7.2 -phpini /etc/php/7.2/fpm/php.ini -type fpm -id php72-fpm-custom -clipath /usr/bin/php -service php7.2-fpm -poold /etc/php/7.2/fpm/pool.d
Additional Information
How to add a custom PHP version in Plesk for Linux?
Official Plesk documentation: Adding Custom PHP Versions (Linux)
Comments
0 comments
Please sign in to leave a comment.