【发布时间】:2019-03-11 08:39:16
【问题描述】:
我缺少包含 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
【问题讨论】:
标签: php docker redis debian-stretch