

How to install PHP 5.6 and 7.0 - 8.3 with PHP-FPM and FastCGI mode for ISPConfig...
source link: https://www.howtoforge.com/ispconfig-php-ubuntu/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to install PHP 5.6 and 7.0 - 8.3 with PHP-FPM and FastCGI mode for ISPConfig 3.2 with apt on Ubuntu 18.04 - 22.04
When using ISPConfig, by default, you only have the main PHP version for your distribution. This guide will show you how to install multiple PHP versions (5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.1, 8.2 and 8.3) on a Ubuntu server with ISPConfig. A similar guide for multiple PHP versions is available for Debian systems, which can be found here.
After installing the additional versions, you can select them for use on specific websites in both PHP-FPM and FastCGI mode in ISPConfig. This guide is compatible with apache web server and also nginx web server.
1 Preliminary Note
In this guide, you will add the SURY repository additional repository to install the PHP packages from with apt. Because other packages as OpenSSL, are updated too, the installed packages from sury.org can not simply be removed after installation. So do not remove SURY as a repository source later on.
Please note that PHP-FPM can be used on Apache and Nginx servers, while FastCGI is available only for Apache servers.
2 Add SURY repository
Add the repository:
add-apt-repository -y ppa:ondrej/php
Now update the package list:
apt-get update
To upgrade already installed packages from the new repository use this command:
apt-get upgrade
3 Install additional PHP versions
You don't have to install every version listed here, install the ones you need.
3.1 Install PHP 5.6
To install PHP use this command:
apt-get install php5.6 php5.6-cli php5.6-cgi php5.6-fpm php5.6-gd php5.6-mysql php5.6-imap php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip php5.6-mbstring php5.6-soap php5.6-opcache libicu65 php5.6-common php5.6-json php5.6-readline php5.6-xml
3.2 Install PHP 7.0
To install PHP use this command:
apt-get install php7.0 php7.0-cli php7.0-cgi php7.0-fpm php7.0-gd php7.0-mysql php7.0-imap php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-zip php7.0-mbstring php7.0-soap php7.0-opcache php7.0-common php7.0-json php7.0-readline php7.0-xml
3.3 Install PHP 7.1
To install PHP use this command:
apt-get install php7.1 php7.1-cli php7.1-cgi php7.1-fpm php7.1-gd php7.1-mysql php7.1-imap php7.1-curl php7.1-intl php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-xmlrpc php7.1-xsl php7.1-zip php7.1-mbstring php7.1-soap php7.1-opcache php7.1-common php7.1-json php7.1-readline php7.1-xml
3.4 Install PHP 7.2
To install PHP use this command:
apt-get install php7.2 php7.2-cli php7.2-cgi php7.2-fpm php7.2-gd php7.2-mysql php7.2-imap php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-zip php7.2-mbstring php7.2-soap php7.2-opcache php7.2-common php7.2-json php7.2-readline php7.2-xml
3.5 Install PHP 7.3
To install PHP use this command:
apt-get install php7.3 php7.3-cli php7.3-cgi php7.3-fpm php7.3-gd php7.3-mysql php7.3-imap php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php7.3-zip php7.3-mbstring php7.3-soap php7.3-opcache php7.3-common php7.3-json php7.3-readline php7.3-xml
3.6 Install PHP 7.4
To install PHP 7.4 use this command:
apt-get install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig5 php7.4-common php7.4-json php7.4-readline php7.4-xml
3.7 Install PHP 8.0
To install PHP 8.0 use this command:
apt-get install php8.0 php8.0-cli php8.0-cgi php8.0-fpm php8.0-gd php8.0-mysql php8.0-imap php8.0-curl php8.0-intl php8.0-pspell php8.0-sqlite3 php8.0-tidy php8.0-xsl php8.0-zip php8.0-mbstring php8.0-soap php8.0-opcache libonig5 php8.0-common php8.0-readline php8.0-xml
3.8 Install PHP 8.1
To install PHP 8.1 use this command:
apt-get install php8.1 php8.1-cli php8.1-cgi php8.1-fpm php8.1-gd php8.1-mysql php8.1-imap php8.1-curl php8.1-intl php8.1-pspell php8.1-sqlite3 php8.1-tidy php8.1-xsl php8.1-zip php8.1-mbstring php8.1-soap php8.1-opcache libonig5 php8.1-common php8.1-readline php8.1-xml
3.9 Install PHP 8.2
To install PHP 8.2 use this command:
apt-get install php8.2 php8.2-cli php8.2-cgi php8.2-fpm php8.2-gd php8.2-mysql php8.2-imap php8.2-curl php8.2-intl php8.2-pspell php8.2-sqlite3 php8.2-tidy php8.2-xsl php8.2-zip php8.2-mbstring php8.2-soap php8.2-opcache libonig5 php8.2-common php8.2-readline php8.2-xml
3.10 Install PHP 8.3
To install PHP 8.3 use this command:
apt-get install php8.3 php8.3-cli php8.3-cgi php8.3-fpm php8.3-gd php8.3-mysql php8.3-imap php8.3-curl php8.3-intl php8.3-pspell php8.3-sqlite3 php8.3-tidy php8.3-xsl php8.3-zip php8.3-mbstring php8.3-soap php8.3-opcache php8.3-common php8.3-readline php8.3-xml
4 Set the OS default PHP back to the correct version
The default PHP of the operating system has to remain at the original version. To fix that, run these commands one by one:
update-alternatives --config php
update-alternatives --config php-cgi
update-alternatives --config php-fpm.sock
On Ubuntu 18.04, choose 7.2, on Ubuntu 20.04, choose 7.4, on Ubuntu 22.04, choose 8.1.
5 Add PHP versions to ISPConfig
In ISPConfig 3, you can configure the new PHP versions under System > Additional PHP Versions > Add new PHP version.
Add the distribution's default PHP version
First of all you have to add a new version for the already installed PHP version. The default version depends on the release you are on:
Ubuntu 18.04: PHP 7.2
Ubuntu 20.04: PHP 7.4
Ubuntu 22.04: PHP 8.1
See below for the configuration for your version.
Configuration for the additional PHP versions
PHP 5.6
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi5.6
Path to the php.ini directory: /etc/php/5.6/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php5.6-fpm
Path to the php.ini directory: /etc/php/5.6/fpm/
Path to the PHP-FPM pool directory: /etc/php/5.6/fpm/pool.d/
The cli version for e.g. cron jobs has the name php5.6
PHP 7.0
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi7.0
Path to the php.ini directory: /etc/php/7.0/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php7.0-fpm
Path to the php.ini directory: /etc/php/7.0/fpm/
Path to the PHP-FPM pool directory: /etc/php/7.0/fpm/pool.d/
The cli version for e.g. cron jobs has the name php7.0
PHP 7.1
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi7.1
Path to the php.ini directory: /etc/php/7.1/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php7.1-fpm
Path to the php.ini directory: /etc/php/7.1/fpm/
Path to the PHP-FPM pool directory: /etc/php/7.1/fpm/pool.d/
The cli version for e.g. cron jobs has the name php7.1
PHP 7.2
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi7.2
Path to the php.ini directory: /etc/php/7.2/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php7.2-fpm
Path to the php.ini directory: /etc/php/7.2/fpm/
Path to the PHP-FPM pool directory: /etc/php/7.2/fpm/pool.d/
The cli version for e.g. cron jobs has the name php7.2
PHP 7.3
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi7.3
Path to the php.ini directory: /etc/php/7.3/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php7.3-fpm
Path to the php.ini directory: /etc/php/7.3/fpm/
Path to the PHP-FPM pool directory: /etc/php/7.3/fpm/pool.d/
The cli version for e.g. cron jobs has the name php7.3
PHP 7.4
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi7.4
Path to the php.ini directory: /etc/php/7.4/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php7.4-fpm
Path to the php.ini directory: /etc/php/7.4/fpm/
Path to the PHP-FPM pool directory: /etc/php/7.4/fpm/pool.d/
The cli version for e.g. cron jobs has the name php7.4
PHP 8.0
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi8.0
Path to the php.ini directory: /etc/php/8.0/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php8.0-fpm
Path to the php.ini directory: /etc/php/8.0/fpm/
Path to the PHP-FPM pool directory: /etc/php/8.0/fpm/pool.d/
The cli version for e.g. cron jobs has the name php8.0
PHP 8.1
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi8.1
Path to the php.ini directory: /etc/php/8.1/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php8.1-fpm
Path to the php.ini directory: /etc/php/8.1/fpm/
Path to the PHP-FPM pool directory: /etc/php/8.1/fpm/pool.d/
The cli version for e.g. cron jobs has the name php8.1
PHP 8.2
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi8.2
Path to the php.ini directory: /etc/php/8.2/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php8.2-fpm
Path to the php.ini directory: /etc/php/8.2/fpm/
Path to the PHP-FPM pool directory: /etc/php/8.2/fpm/pool.d
The cli version for e.g. cron jobs has the name php8.2
PHP 8.3
Fast-CGI settings:
Path to the PHP FastCGI binary: /usr/bin/php-cgi8.3
Path to the php.ini directory: /etc/php/8.3/cgi/
PHP-FPM settings:
Path to the PHP-FPM init script: php8.3-fpm
Path to the php.ini directory: /etc/php/8.3/fpm/
Path to the PHP-FPM pool directory: /etc/php/8.3/fpm/pool.d
The cli version for e.g. cron jobs has the name php8.3
6 Conclusion
You can now choose an additional PHP version for your websites. It is not recommended to change default PHP version of the OS (switch PHP version) as many packages incl. ISPConfig depend on that and this would likely break your server. If you have any questions, open a thread in the forum.
Recommend
-
45
实现LNP基于fastcgi模式一,配置前端nginx,web服务器1,修改nginx主配置文件,添加如下内容server{listen80;#监听端口root/nginx/html/;#主网页路径server_namewww.a.com;#网站名location/{fastcgi_pass192.168.68.17:9000;fastcgi_indexindex.php;#默认php页面fa...
-
42
背景虚拟主机  如今服务器的配置提升明显,单一主机上部署单一网站会对主机造成大量的性能损失,因此web服务虚拟主机的技术应运而生。所谓虚拟主机指的是在一台机器上运行多个网站(如company1.example.com和company2.example.com)的做法。虚拟...
-
49
-
45
ISPConfig 3 Roundcube Plugin on Debian 9 (Stretch) On this page Add ISPConfig Remote User Install ISPConfig RoundCube Plugin Copy Plugin to system locati...
-
12
Fastcgi 协议分析与 PHP-FPM 攻击方法 Fastcgi 协议分析与 PHP-FPM 攻击方法 [toc] 前言?没有前言了…… 早期的Web服务器,只能响应浏览...
-
5
Securing your ISPConfig 3 managed mailserver with a valid Let's Encrypt SSL certificate If you're running your own mail server, it's best practice to connect to it securely with an SSL/TLS connection. You'll need a valid certificate...
-
20
Perfect Server Automated ISPConfig 3 Installation on Debian 10 - 11 and Ubuntu 20.04 This tutorial will take you through installing your own ISPConfig 3 single server setup using the ISPConfig auto-installer. This installer follows...
-
12
Update the ISPConfig Perfect Server from Debian 10 to Debian 11 This tutorial will take you through updating a server managed by ISPConfig from Debian 10 (buster) to Debian 11 (bullseye). This guide works for both single- and multis...
-
6
一、最早的Web服务器最早的Web服务器简单地响应浏览器发来的HTTP静态文件请求,并将存储在服务器上的静态文件(例如: jpg、htm、html)返回给浏览器。如图是处理流程 比如我访问:http://www.example.com/index.html,那么网络服...
-
1
How to Add a Website in ISPConfig ISPConfig is a hosting control panel for Linux servers. ISPConfig provides functions for managing websites, databases, FTP and shell users, email accounts, and DNS. In this guide, we will show you step b...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK