首页 > 解决方案 > 如何在 Debian 9 机器上为 PHP 7.3 安装 php-fpm?

问题描述

我正在尝试通过 ssh(使用sudo apt-get install -y php-fpm)在 Debian 9 机器上安装 php-fpm,但出现以下错误

Package php-fpm is a virtual package provided by:
  php7.4-fpm 7.4.7-1+0~20200612.18+debian9~1.gbp671911 [Not candidate version]
  php7.3-fpm 7.3.19-1+0~20200612.60+debian9~1.gbp6c8fe1 [Not candidate version]
  php7.2-fpm 7.2.31-1+0~20200514.41+debian9~1.gbpe2a56b [Not candidate version]
  php7.1-fpm 7.1.33-16+0~20200514.38+debian9~1.gbp1e5820 [Not candidate version]
  php7.0-fpm 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f [Not candidate version]
  php5.6-fpm 5.6.40-29+0~20200514.35+debian9~1.gbpcc49a4 [Not candidate version]
  php7.3-fpm 7.3.14-1~deb10u1 [Not candidate version]
  php7.3-fpm 7.3.11-1~deb10u1 [Not candidate version]
  php7.0-fpm 7.0.33-0+deb9u7 [Not candidate version]
  php7.0-fpm 7.0.33-0+deb9u6 [Not candidate version]

E: Package 'php-fpm' has no installation candidate

我试过sudo apt-get install -y php7.3-fpm了,但我得到了错误:

Package php7.3-fpm is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php7.3-fpm' has no installation candidate

目前我的 sources.list 是:

# deb http://snapshot.debian.org/archive/debian/20200224T000000Z stretch main
deb http://deb.debian.org/debian stretch main
# deb http://snapshot.debian.org/archive/debian-security/20200224T000000Z stretcc
h/updates main
deb http://security.debian.org/debian-security stretch/updates main
# deb http://snapshot.debian.org/archive/debian/20200224T000000Z stretch-updatess
 main
deb http://deb.debian.org/debian stretch-updates main

有任何想法吗?

编辑:

忘了提我正在使用apache。

标签: phplinuxdebianfastcgifpm

解决方案


也许这可以帮助

sudo apt update
sudo apt install nginx
sudo apt install ufw
apt install php-fpm

你可以在这里了解更多:https ://itdraft.ru/2019/08/27/ustanovka-nginx-i-php-fpm-na-debian-10/


推荐阅读