3

我缺少包含该php-redis软件包的存储库。在我的 debian 9/stretch docker 容器中,我运行以下命令:

root@dcc82d674095 [19:36:46] [/var/www/html]
-> # apt-get install php-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php-redis 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 'php-redis' has no installation candidate

但是,如果我运行,apt search php-redis我可以看到它在“那里”:

root@dcc82d674095 [19:41:18] [/var/www/html]
-> # apt search php-redis
Sorting... Done
Full Text Search... Done
php-redis/stable,stable 3.1.1-1 amd64
  (none)

我的/etc/apt/sources.list样子是这样的:

deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb http://deb.debian.org/debian stretch-updates main

我的猜测是我缺少该sources.list文件中的资源。我错过了什么回购?我也想知道我是如何找到来源的,所以类似的情况再次发生,我可以弄清楚而不是问另一个问题。

我查看了此页面 - 但无法找出任何看起来应该将其添加到我的sources.list文件中的链接。(这只是我对出了什么问题的假设)。

https://packages.debian.org/source/stretch/php-redis


编辑:

虽然我仍然有兴趣找到我的问题的答案,但我通过 pecl 安装软件包找到了解决方法。在我的 docker 文件中,我添加了以下内容:

# printf statement mocks answering the prompts from the pecl install
RUN printf "\n \n" | pecl install redis && docker-php-ext-enable redis
4

1 回答 1

2

如果您使用 php:7.1-fpm-stretch 容器,所有 php-*** 包都将被阻止安装,请参阅此处的详细信息:https ://github.com/docker-library/php/issues/713

于 2019-11-23T19:00:45.983 回答