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

时间:2019-09-15 12:04:08

标签: php docker

如何在官方php:php-fpm码头工人镜像中启用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

2 个答案:

答案 0 :(得分:1)

您可以将其安装为PHP扩展,从日志中可以看到它在存储库中不可用。

{% for post in site.categories.category1 %}
  <h2>{{ post.title }}</h2>
  // insert your code
{% endfor %}

答案 1 :(得分:0)

将行添加到Dockerfile



RUN apt-get install php-zip  -y