/errors/composer/zip-extension-and-unzip-7z-commands-missing
Composer: The zip extension and unzip/7z commands are both missing, skipping.
- tool
- Composer
- versions
- Composer 2.x
- os
- linux, macos, windows
The zip extension and unzip/7z commands are both missing, skipping. means Composer downloaded a package as a zip archive (the default "dist" install) and had no way to extract it: PHP has no zip extension and neither unzip nor 7z is on the PATH. Install unzip (fastest, and keeps file permissions) or the PHP zip extension, then run composer install again.
Where it appears
Composer's ZipDownloader throws this message as a RuntimeException, followed by the location of the loaded php.ini so you can check where to enable the extension. If proc_open is disabled in php.ini, the message changes to The zip extension is missing and unzip/7z commands cannot be called as proc_open is disabled, skipping.
Fix
Debian or Ubuntu based image:
FROM php:8.3-cli
RUN apt-get update \
&& apt-get install -y --no-install-recommends unzip libzip-dev \
&& docker-php-ext-install zip \
&& rm -rf /var/lib/apt/lists/*Alpine based image:
FROM php:8.3-cli-alpine
RUN apk add --no-cache unzip libzip-dev \
&& docker-php-ext-install zipOn a host, check what PHP loads:
php --ini # the php.ini files in use
php -m | grep -i zip # prints "zip" when the extension is enabled
command -v unzip 7z # prints the path of the tools that exist