Skip to content
Latchkey

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

  1. Add zip to the setup-php extensions input.
  2. Re-run so Composer extracts dist archives in-process.
  3. Confirm with php -m | grep -i zip.
.github/workflows/ci.yml
- uses: shivammathur/setup-php@v2
  with:
    php-version: '8.2'
    extensions: zip

Or 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 unzip

How to prevent it

  • Include zip in 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →