Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php:php fpm docker映像中启用php模块_Php_Docker - Fatal编程技术网

在php:php fpm docker映像中启用php模块

在php:php fpm docker映像中启用php模块,php,docker,Php,Docker,我如何在docker官方图片中启用PHP模块?无法安装php zip,例如: root@122f1612f817:/var/www/html# apt-cache policy php-zip php-zip: Installed: (none) Candidate: (none) Version table: 2:7.3+69 -1 500 http://deb.debian.org/debian buster/main amd64 Packages root@122

我如何在docker官方图片中启用PHP模块?无法安装
php zip
,例如:

root@122f1612f817:/var/www/html# apt-cache policy php-zip
php-zip:
Installed: (none)
Candidate: (none)
Version table:
    2:7.3+69 -1
        500 http://deb.debian.org/debian buster/main amd64 Packages

root@122f1612f817:/var/www/html# apt-get install php-zip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php-zip is a virtual package provided by:
php7.3-zip 7.3.4-2 [Not candidate version]

E: Package 'php-zip' has no installation candidate

您可以将其安装为PHP扩展,因为从日志中可以看出,它在repo中不可用

FROM php:7.2-fpm 
RUN apt-get update
RUN apt-get install libzip-dev -y
RUN docker-php-ext-configure zip --with-libzip \
  && docker-php-ext-install zip
将行添加到Dockerfile



RUN apt-get install php-zip  -y


你能试试“zip”而不是“php-zip”吗?