当我运行一个作曲器更新时,我得到这个错误消息:

Loading composer repositories with package information
Updating dependencies (including require-dev)
    Failed to download psr/log from dist: The zip extension and unzip command are both missing, skipping.
The php.ini used by your command-line PHP is: /etc/php/7.0/cli/php.ini
    Now trying to download from source

我需要做什么才能启用zip和unzip命令,以便编写器可以下载依赖项?


当前回答

对于Debian Jessie(这是Docker Hub上PHP映像的当前默认):

apt-get install --yes zip unzip php-pclzip

你可以省略——是的,但当你在Dockerfile中运行它时,它很有用。

其他回答

我正在使用Ubuntu,并使用以下命令工作

Apt-get install——yes zip unzip

对于Debian Jessie(这是Docker Hub上PHP映像的当前默认):

apt-get install --yes zip unzip php-pclzip

你可以省略——是的,但当你在Dockerfile中运行它时,它很有用。

对于使用PHP 5.6的服务器

sudo apt-get install zip unzip php5.6-zip

对于较旧的Ubuntu发行版,如16.04,14.04,12.04等

sudo apt-get install zip unzip php7.0-zip

在docker上使用image php:7.2-apache,我只需要zip和unzip。不需要php-zip:

安装zip解压

或 Dockerfile

RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "zip"]
RUN ["apt-get", "install", "-y", "unzip"]