作曲家要求ext-zip失败 [英] Composer require ext-zip fails
问题描述
PHPStorm告诉我,我需要作曲家需要ext-zip,但是该命令失败了.
I am told by PHPStorm that I need to composer require ext-zip, however, that command is failing...
PHPStorm说
我发出的命令是
composer require ext-zip
产生
Your requirements could not be resolved to an installable set of packages.
和
Installation failed, reverting ./composer.json to its original content.
推荐答案
解决方案1 -将ext-zip添加到composer.json的必需部分:
Solution #1 - add ext-zip to your required section of composer.json:
{
"require" : {
"ext-zip": "*"
}
}
解决方案2 -安装php-zip扩展名:
Solution #2 - install php-zip extension:
Windows:
在您的php.ini中取消注释此行
Uncomment this line in your php.ini
; extension = php_zip.dll
;extension=php_zip.dll
Linux:
sudo apt-get install php-zip
sudo apt-get install php-zip
或
sudo apt-get install php7.0-zip(确保输入了您的php版本,您可以通过执行php -v命令来检查您的版本)
sudo apt-get install php7.0-zip (make sure you typed YOUR php version, you can check your version by doing php -v command)
然后,您需要重新启动Web服务器.
Then, you need to restart your web server.
sudo服务apache2重新启动
sudo service apache2 restart
这篇关于作曲家要求ext-zip失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!