我缺少包含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