我缺少包含php-redis包的存储库。在我的debian 9/拉伸码头容器中,我运行以下操作:
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发布于 2019-11-23 19:00:45
如果您使用php:7.1-fpm-拉伸容器,所有php-*包都会被阻止安装,请参阅详细信息:https://github.com/docker-library/php/issues/713
https://stackoverflow.com/questions/52672382
复制相似问题