Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a problem with using php-zip (composer warns about it)? [duplicate]

When I run a 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 composer can download dependencies?

like image 968
b85411 Avatar asked May 11 '26 17:05

b85411


2 Answers

Depending on your flavour of Linux and PHP version these may vary.

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

This is a very commonly asked question, you'll be able to find more useful info in the aether by searching <distro> php <version> zip extension.

like image 194
Arrisar Avatar answered May 13 '26 05:05

Arrisar


For Windows, in case you're using a locale development environment like XAMPP, just locate the php.ini file (C:\xampp\php in my case), open it and remove the semicolon from the following line.

;extension=zip

Restart your Apache webserver and it will work fine.

like image 35
Niklas Avatar answered May 13 '26 07:05

Niklas