【发布时间】:2020-03-19 06:09:07
【问题描述】:
我正在使用 docker image php:7.4.3-apache,我需要安装 php7.4-cgi。图片在 Debian 10 上运行。我尝试了很多教程,但都没有成功。
等等。本教程https://kifarunix.com/install-php-7-4-on-debian-10-debian-9/
当我运行安装命令时出现以下错误:
root@eafa0aac715a:/usr/local/bin# apt install php7.4-cgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php7.4-cgi 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 'php7.4-cgi' has no installation candidate
我不知道自己做错了什么。
我创建了新的 clear dockerfile:
FROM php:7.4.3-apache
RUN apt-get -y install apt-transport-https lsb-release ca-certificates curl
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN apt-get update
RUN apt install php7.4-cgi
有人可以修复这个 dockerfile 以进行构建吗?
【问题讨论】:
-
如果您特别需要
php-cgi二进制文件,您也可以使用php:<version>-cli标签