PHP error: "Zip and unzip installations are missing, skipping."

When I run composer update , I get this error message:

 Loading composer repositories with package information Updating dependencies (including require-dev) Failed to download psr/log from dist: The zip extension and unzip command are both missing, skipping. The php.ini used by your command-line PHP is: /etc/php/7.0/cli/php.ini Now trying to download from source 

What do I need to do to enable the zip and unzip commands so that the composer can load the dependencies?

+108
php composer-php
Dec 22 '16 at 2:13
source share
11 answers

Depending on your version of Linux and PHP, they may be different.

 (sudo) yum install zip unzip php-zip (sudo) apt install zip unzip php-zip 

This is a very frequently asked question, you can find more useful information on the air by searching for <distro> php <version> zip extension .

+246
Dec 22 '16 at 2:18
source share

For servers with PHP 5.6

 sudo apt-get install zip unzip php5.6-zip 
+38
Jan 23 '17 at 9:52 on
source share

For Debian Jessie (which is the current default value for the PHP image on the Docker Hub):

 apt-get install --yes zip unzip php-pclzip 

You can omit -yes, but this is useful when you run it in a Docker file.

+20
Jun 14 '17 at 12:49 on
source share

For older distributions of Ubuntu, as well as 16.04, 14.04, 12.04, etc.

 sudo apt-get install zip unzip php7.0-zip 
+19
Jan 22 '17 at 21:42 on
source share

I had PHP7.2 on a Ubuntu 16.04 server and it solved my problem:

sudo apt-get install zip unzip php-zip

Refresh

Tried this for Ubuntu 18.04 and worked too.

+11
Feb 13 '18 at 10:48
source share

I am using Ubuntu and executed the following command

apt-get install --yes zip unzip

+4
Dec 29 '17 at 16:07
source share

If you are using Ubuntu and PHP 7.2 , use this ...

 sudo apt-get update sudo apt-get install zip unzip php7.2-zip 
+3
Jun 01 '18 at 15:34
source share

I got this error when I installed Laravel 5.5 on my digitalocean cloud server (Ubuntu 18.04 and PHP 7.2) and the following team fixed it.

sudo apt install zip unzip php7.2-zip

+1
Oct 24 '18 at 6:39
source share

On the docker with the php:7.2-apache image, I just needed zip and unzip. No need for php-zip:

apt-get install zip unzip

or dockerfile

 RUN ["apt-get", "update"] RUN ["apt-get", "install", "-y", "zip"] RUN ["apt-get", "install", "-y", "unzip"] 
+1
Aug 29 '19 at 11:30
source share

Actually, at present, composer seems to work without the zip command line, so php-zip installation should be enough, BUT a warning will be displayed:

Since the unzip command is not installed, zip files are unpacked using the PHP zip extension. This can lead to incorrect reporting of corrupted archives. Installing 'unzip' may fix them.

See also. Is there a problem using php-zip (the composer warns about this)

0
Sep 21 '18 at 13:12
source share

Starting with PHP 7.3 you just need to:

apt-get update && apt-get install zip unzip

0
Apr 28 '19 at 18:25
source share



All Articles