无法在 Debian 9 上安装 php7.4-soap

Can not install php7.4-soap on Debian 9

我使用的是 Debian 9,我最近 PHP 从 5.6 升级到 7.4。我被

击中了

Class 'SoapClient' not found

当 运行使用旧的 PHP 脚本时出错,该脚本在 PHP 5.6 下运行良好。 phpinfo() 列出了“SOAP”模块,但它没有列出“Soap 客户端”的专用“soap”部分(如前所述 here)。

我认为问题是我没有安装 php7.4-soap 扩展,所以我 运行 sudo apt-get install php7.4-soap,但我得到了这些错误:

Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 php7.4-soap : Depends: php7.4-common (= 7.4.20-1+ubuntu21.04.1+deb.sury.org+1) but 7.4.16-1+0~20210305.42+debian9~1.gbpbbe65e is to be installed
               Depends: libc6 (>= 2.33) but 2.24-11+deb9u4 is to be installed
E: Unable to correct problems, you have held broken packages.

我也尝试手动安装 php7.4-common,但安装失败并出现以下错误:

 php7.4-common : Depends: libc6 (>= 2.33) but 2.24-11+deb9u4 is to be installed
                 Depends: libffi8ubuntu1 (>= 3.4~20200819) but it is not installable
E: Unable to correct problems, you have held broken packages.

如何解决此类问题?谢谢。

我的grep -Rn --include=\*.list ^[^\#] /etc/apt/输出是:

/etc/apt/sources.list.d/mysql.list:4:deb http://repo.mysql.com/apt/debian/ stretch mysql-apt-config
/etc/apt/sources.list.d/mysql.list:5:deb http://repo.mysql.com/apt/debian/ stretch mysql-5.6
/etc/apt/sources.list.d/mysql.list:6:deb http://repo.mysql.com/apt/debian/ stretch mysql-tools
/etc/apt/sources.list.d/mysql.list:8:deb-src http://repo.mysql.com/apt/debian/ stretch mysql-5.6
/etc/apt/sources.list.d/dotdeb.list:1:deb http://packages.dotdeb.org wheezy-php56 all
/etc/apt/sources.list.d/dotdeb.list:2:deb-src http://packages.dotdeb.org wheezy-php56 all
/etc/apt/sources.list.d/php.list:1:deb https://packages.sury.org/php/ stretch main
/etc/apt/sources.list:17:deb http://mirrors.linode.com/debian stretch main
/etc/apt/sources.list:18:deb-src http://mirrors.linode.com/debian stretch main
/etc/apt/sources.list:20:deb http://mirrors.linode.com/debian-security/ stretch/updates main
/etc/apt/sources.list:21:deb-src http://mirrors.linode.com/debian-security/ stretch/updates main
/etc/apt/sources.list:24:deb http://mirrors.linode.com/debian stretch-updates main
/etc/apt/sources.list:25:deb-src http://mirrors.linode.com/debian stretch-updates main

在 debian 上,php7.4-soap 可用于 bullseye and sid

在 debian Stretch 上,您可以从 Sury repo 安装 php7.4-soap

sudo apt install apt-transport-https software-properties-common lsb-release ca-certificates
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" sudo tee /etc/apt/sources.list.d/php.list
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
sudo apt update
sudo apt install php7.4-soap