如何在 Debian 9 到 11 上使用 PHP-FPM 和 FastCGI 模式为 ISPConfig 3.2 安装 PHP 5.6 和 7.0 - 8.2 以及 apt如何在 Debian 9 到 11 上使用 PHP-FPM 和 FastCGI 模式为 ISPConfig 3.2 安装 PHP 5.6 和 7.0 - 8.2 以及 apt如何在 Debian 9 到 11 上使用 PHP-FPM 和 FastCGI 模式为 ISPConfig 3.2 安装 PHP 5.6 和 7.0 - 8.2 以及 apt如何在 Debian 9 到 11 上使用 PHP-FPM 和 FastCGI 模式为 ISPConfig 3.2 安装 PHP 5.6 和 7.0 - 8.2 以及 apt
  • 文章
  • 正则表达式
    • 工具
  • 登录
找到的结果: {phrase} (显示: {results_count} 共: {results_count_total})
显示: {results_count} 共: {results_count_total}

加载更多搜索结果...

搜索范围
模糊匹配
搜索标题
搜索内容
发表 admin at 2025年2月28日
类别
  • 未分类
标签

如何在 Debian 9 到 11 上使用 PHP-FPM 和 FastCGI 模式为 ISPConfig 3.2 安装 PHP 5.6 和 7.0 - 8.2 以及 apt

在此页

  1. 1 条初步说明
  2. 2 添加 SURY 存储库
  3. 3 安装其他 PHP 版本
    1. 3.1 安装 PHP 5.6
    2. 3.2 安装 PHP 7.0
    3. 3.3 安装 PHP 7.1
    4. 3.4 安装 PHP 7.2
    5. 3.5 安装 PHP 7.3
    6. 3.6 安装 PHP 7.4
    7. 3.7 安装 PHP 8.0
    8. 3.8 安装 PHP 8.1
    9. 3.9 安装 PHP 8.2

    1. 添加发行版默认 PHP 版本
    2. 其他 PHP 版本的配置
      1. PHP 5.6
      2. PHP 7.0
      3. PHP 7.1
      4. PHP 7.2
      5. PHP 7.3
      6. PHP 7.4
      7. PHP 8.0
      8. PHP 8.1
      9. PHP 8.2

      使用 ISPConfig 时,默认情况下,您只有主要的 PHP 版本用于您的分发。本指南将引导您使用 ISPConfig 在 Debian 服务器上安装其他 PHP 版本(5.6、7.0、7.1、7.2、7.3、7.4、8.1 和 8.2)。可在此处找到适用于 Ubuntu 系统的类似指南。

      安装附加版本后,您可以选择它们以在 PHP-FPM 和 FastCGI 模式下用于特定网站。

      1 初步说明

      在本指南中,您将添加 SURY 存储库附加存储库以使用 apt 安装 PHP 包。因为 OpenSSL 等其他软件包也已更新,所以无法在安装后简单地删除来自 sury.org 的已安装软件包。因此,以后不要将 SURY 作为存储库源删除。

      请注意,PHP-FPM 可用于 Apache 和 Nginx 服务器,而 FastCGI 仅适用于 Apache 服务器。

      2 添加 SURY 存储库

      首先安装这些必需的包:

      apt-get install -y apt-transport-https lsb-release ca-certificates

      现在通过运行以下命令添加存储库密钥:

      wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg >/dev/null 2>&1

      和存储库本身:

      echo "deb https://packages.sury.org/php/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/php.list

      现在更新包列表:

      apt-get update

      要从新存储库升级已安装的软件包,请使用以下命令:

      apt-get upgrade

      3 安装其他 PHP 版本

      您不必安装此处列出的每个版本,安装您需要的版本。

      3.1 安装PHP 5.6

      要安装 PHP,请使用以下命令:

      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 安装PHP 7.0

      要安装 PHP,请使用以下命令:

      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 安装 PHP 7.1

      要安装 PHP,请使用以下命令:

      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 安装 PHP 7.2

      要安装 PHP,请使用以下命令:

      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 安装 PHP 7.3

      要安装 PHP,请使用以下命令:

      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 安装 PHP 7.4

      要安装 PHP 7.4,请使用以下命令:

      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 安装 PHP 8.0

      要安装 PHP 8.0,请使用以下命令:

      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 安装 PHP 8.1

      要安装 PHP 8.1,请使用以下命令:

      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 安装 PHP 8.2

      要安装 PHP 8.2,请使用以下命令:

      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

      4 将操作系统默认 PHP 设置回正确的版本

      操作系统的默认 PHP 必须保持原始版本。要解决这个问题,请一一运行这些命令:

      update-alternatives --config php
      update-alternatives --config php-cgi
      update-alternatives --config php-fpm.sock

      在 Debian 11 上,选择 7.4,在 Debian 10 上,选择 7.3,在 Debian 9 上,选择 PHP 7.0。

      5 将 PHP 版本添加到 ISPConfig

      在 ISPConfig 3 中,您可以在系统 > 其他 PHP 版本 > 添加新的 PHP 版本下配置新的 PHP 版本。

      添加发行版默认 PHP 版本

      首先,您必须为已经安装的 PHP 版本添加一个新版本。默认版本取决于您所在的版本:

      Debian 9:PHP 7.0
      Debian 10:PHP 7.3
      Debian 11:PHP 7.4

      有关您的版本的配置,请参见下文。

      其他 PHP 版本的配置

      PHP 5.6

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi5.6
      Path to the php.ini directory: /etc/php/5.6/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php5.6

      PHP 7.0

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi7.0
      Path to the php.ini directory: /etc/php/7.0/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php7.0

      PHP 7.1

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi7.1
      Path to the php.ini directory: /etc/php/7.1/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php7.1

      PHP 7.2

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi7.2
      Path to the php.ini directory: /etc/php/7.2/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php7.2

      PHP 7.3

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi7.3
      Path to the php.ini directory: /etc/php/7.3/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php7.3

      PHP 7.4

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi7.4
      Path to the php.ini directory: /etc/php/7.4/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php7.4

      PHP 8.0

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi8.0
      Path to the php.ini directory: /etc/php/8.0/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php8.0

      PHP 8.1

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi8.1
      Path to the php.ini directory: /etc/php/8.1/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php8.1

      PHP 8.2

      快速 CGI 设置:

      Path to the PHP FastCGI binary: /usr/bin/php-cgi8.2
      Path to the php.ini directory: /etc/php/8.2/cgi/

      PHP-FPM 设置:

      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

      例如的 cli 版本cron 作业的名称为 php8.2

      六,结论

      您现在可以为您的网站选择其他 PHP 版本。如果您有任何问题,请在论坛中打开一个话题。

©2015-2025 艾丽卡 support@alaica.com