尝试在安装了php7.3的镜像上安装php-xmlrpc。

如您所见,我尝试了apt-get update,但没有帮助。我也尝试过使用php7.3-xmlrpc

Dockerfile行:RUN apt-get update && apt-get install php-xmlrpc -y
Docker构建输出:

Step 5/8 : RUN apt-get update && apt-get install php-xmlrpc -y
 ---> Running in 163542fabd8a
Get:1 http://security-cdn.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:2 http://security-cdn.debian.org/debian-security buster/updates InRelease [39.1 kB]
Ign:3 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:4 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 Packages [500 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Hit:6 http://cdn-fastly.deb.debian.org/debian buster InRelease
Get:7 http://security-cdn.debian.org/debian-security buster/updates/main amd64 Packages [112 kB]
Get:8 http://cdn-fastly.deb.debian.org/debian buster-updates InRelease [49.3 kB]
Get:9 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages.diff/Index [12.5 kB]
Get:10 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages 2019-10-27-2015.53.pdiff [398 B]
Get:12 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages 2019-11-06-2017.59.pdiff [903 B]
Get:12 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages 2019-11-06-2017.59.pdiff [903 B]
Hit:11 http://cdn-fastly.deb.debian.org/debian stretch Release
Fetched 900 kB in 1s (634 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package php-xmlrpc is a virtual package provided by:
  php7.3-xmlrpc 7.3.11-1~deb10u1 [Not candidate version]
  php7.3-xmlrpc 7.3.4-2 [Not candidate version]
  php7.0-xmlrpc 7.0.33-0+deb9u6 [Not candidate version]
  php7.0-xmlrpc 7.0.33-0+deb9u3 [Not candidate version]

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

最佳答案

Docker文件:

FROM php:7.3-apache

RUN apt-get update -y && apt-get upgrade -y;
RUN apt-get install -y libxml2-dev
RUN docker-php-ext-install -j$(nproc) xmlrpc

那个有效。

如果以这种方式构建它:
docker build --tag stackoverflow .

然后您可以通过runnig命令检查已安装的扩展程序:
docker run -it --entrypoint="" --rm stackoverflow /bin/bash

并输入控制台
php -m

给出输出:
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zlib

与:
xmlrpc

关于php - E:软件包 'php-xmlrpc'没有候选安装,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58750877/

10-14 18:58