PHP error: “The zip extension and unzip command are both missing, skipping.”

前端 未结 13 816
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 13:12

When I run a composer update I get this error message:

Loading composer repositories with package information
Updating dependencies (including r         


        
13条回答
  •  北荒
    北荒 (楼主)
    2020-12-12 13:54

    Not to belabor the point, but if you are working in a Dockerfile, you would solve this particular issue with Composer by installing the unzip utility. Below is an example using the official PHP image to install unzip and the zip PHP extension for good measure.

    FROM php:7.4-apache
    
    # Install Composer
    COPY --from=composer /usr/bin/composer /usr/bin/composer
    
    # Install unzip utility and libs needed by zip PHP extension 
    RUN apt-get update && apt-get install -y \
        zlib1g-dev \
        libzip-dev \
        unzip
    RUN docker-php-ext-install zip
    

    This is a helpful GitHub issue where the above is lovingly lifted from.

提交回复
热议问题