Composer "The zip extension and unzip/7z commands are both missing" in CI
To install from dist, Composer must unzip archives using either the PHP zip extension or an external unzip/7z binary. When both are absent it falls back to slower source installs, and a warning about extraction reliability appears.
What this error means
composer install warns "The zip extension and unzip/7z commands are both missing, skipping." and dist installs fall back to Git source, slowing the job.
Composer
The zip extension and unzip/7z commands are both missing, skipping.
As there is no plugin allowed to extract this archive the installation will fail.Common causes
ext-zip is not loaded on the runner PHP
The runner PHP has no zip extension, so Composer cannot extract dist zips in-process.
No unzip or 7z binary on the runner
The image also lacks the external unzip/7z tools, leaving Composer with no way to extract archives.
How to fix it
Enable ext-zip via setup-php
- Add
zipto the setup-php extensions input. - Re-run so Composer extracts dist archives in-process.
- Confirm with
php -m | grep -i zip.
.github/workflows/ci.yml
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: zipOr install the unzip binary
On a self-managed runner, install unzip so Composer has an external extractor.
Terminal
sudo apt-get update && sudo apt-get install -y unzipHow to prevent it
- Include
zipin the setup-php extensions for composer jobs. - Ensure unzip is present on custom runner images.
- Prefer dist installs so extraction, not Git clones, is the fast path.
Related guides
Composer "requires ext-gd * -> it is missing from your system" in CIFix Composer "requires ext-gd * -> it is missing from your system" in CI - a dependency needs a PHP extension…
Composer "proc_open(): fork failed" in CIFix Composer "proc_open(): fork failed - Cannot allocate memory" in CI - the runner could not spawn a child p…
Composer install slow with no dependency cache in CISpeed up Composer in CI by caching the Composer directory - without a cache, every job re-downloads all dist…