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.
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.
- 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.
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.