Composer require ext-zip fails
✔ Recommended Answer
Solution #1 - add ext-zip to your required section of composer.json:
{ "require" : { "ext-zip": "*" }}
Solution #2 - install php-zip extension:
Windows:
Uncomment this line in your php.ini
;extension=php_zip.dll
Linux:
sudo apt-get install php-zip
or
sudo apt-get install php7.0-zip (make sure you typed YOUR php version, you can check your version by doing php -v command)
Then, you need to restart your web server.
sudo service apache2 restart
Source: stackoverflow.com
Answered By: Yevhen Kuzmenko
If you are experiencing issues with Composer failing to install or update packages due to missing ext-zip
extension, there are a few steps you can take to resolve this issue:
Verify that
ext-zip
is not installed: You can verify if the extension is installed or not by running the following command in the terminal:pythonphp -m | grep zip
If the output does not include
zip
then the extension is not installed.Install
ext-zip
extension: You can install the extension using your system's package manager. For example, on Ubuntu, you can run the following command in the terminal to install the extension:pythonsudo apt-get install php-zip
On other Linux distributions, the package name may be different, so please check the documentation for your system.
Restart the web server: After installing the extension, you may need to restart the web server to ensure that it is loaded properly.
Run
composer update
orcomposer install
command again: Once the extension is installed and the web server is restarted, try running thecomposer update
orcomposer install
command again. It should now be able to install the required packages without any issues.
If the above steps do not resolve the issue, it may be helpful to review the error message that Composer is displaying to determine if there are any other dependencies or conflicts that need to be resolved.
Comments
Post a Comment