Composer cannot unpack packages because zip and unzip are missing
The zip extension and unzip/7z commands are both missing, skipping.Short answer
Composer unpacks downloaded packages with a system unzip or 7z tool, or with PHP's zip extension. The warning appears when neither is available to the PHP that runs Composer. Enable the zip extension in that PHP's php.ini, or install unzip, then run composer install again.
Fix it fast
1Find out which cause you have
Ask the exact PHP that runs Composer which ini file it loads and whether the zip extension is on. Composer may use a different PHP than the one you expect.
php --ini php -m | grep -i zip2Match what you see, then jump to its fix
What does the error look like?
The zip extension and unzip/7z commands are both missing, skipping.
Cause 1 of 2
The zip extension is not enabled in the PHP that runs Composer
1Check
From PHP 8.2 on Windows, php_zip.dll is no longer built in and must be enabled in php.ini. Use the path shown by php --ini.
php --ini2Fix
Open the loaded php.ini and enable the extension by uncommenting or adding this line.
; php.ini
extension=zip3Verify
The module is listed, and Composer no longer shows the warning.
php -m | grep -i zip
composer installConfirmed by php.net
Cause 2 of 2
No unzip or 7z command is installed on the system
1Check
Composer unpacks with a system unzip or 7z utility or with PHP's ZipArchive class. Composer's own guide recommends installing unzip or 7z because ZipArchive does not support every archive feature.
unzip -v
7z2Fix
Install unzip, or 7-Zip, and make sure it is on the PATH of the shell that runs Composer.
sudo apt update && sudo apt install unzip3Verify
The command exists, and the install finishes without the warning.
unzip -v
composer installConfirmed by getcomposer.org
How do I stop it coming back?
- Keep the zip extension on in the php.ini of every environment that runs Composer, including CI images.
- Run php --ini before debugging, since several PHP builds can be installed on one machine.
- Install unzip in your base Docker or server image once, so installs do not depend on ZipArchive.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Apache returns 503 or 504 because PHP-FPM did not answer in time
Error dispatching request
Apache sent the request to PHP-FPM and gave up waiting.
3 causes, each with a fixBack end
AWS SDK for PHP cannot get credentials from the instance profile metadata server
Error retrieving credentials from the instance profile metadata server.
The SDK tries the EC2 instance metadata service when it has no valid credentials from anywhere earlier in its chain.
4 causes, each with a fixBack end
AWS SDK for PHP rejects requests: the signature is from the future
Signature not yet current: {date} is still later than {date}
AWS compares the timestamp in your signed request with its own clock.
2 causes, each with a fixBack end
CodeIgniter 4 cannot write its cache files
CodeIgniter\Cache\Exceptions\CacheException: Cache unable to write to /var/www/app/writable/cache/
CodeIgniter 4's file cache needs a cache directory that the web server can really write to.
2 causes, each with a fixBack end
CodeIgniter 3 loads the model but the property is undefined
The model name you are loading is the name of a resource that is already being used: user
CodeIgniter 3 expects a model file named like its class, with the first letter capitalised, for example User_model.php holding class User_model.
2 causes, each with a fixBack end
CodeIgniter 3 stops with "Your system folder path does not appear to be set correctly"
503 Service Unavailable
CodeIgniter 3's front controller resolves $system_path and then checks that the result is a directory.
3 causes, each with a fix