"The zip extension and unzip/7z commands are both missing, skipping" in Windows during composer install laravel

huangapple go评论72阅读模式
英文:

"The zip extension and unzip/7z commands are both missing, skipping" in Windows during composer install laravel

问题

所以我正在通过Composer在Windows上下载Laravel,但它给我以下错误信息:
"Failed to download symfony/process from dist: The zip extension and unzip/7z commands are both missing, skipping."
我进行了一些谷歌搜索,大多数答案都是使用以下命令:
"sudo apt-get install zip unzip php-zip"。
但我正在使用Windows,找不到与这个问题相关的任何答案。

英文:

so I'm downloading laravel on windows through composer and it is giving me the following error
" Failed to download symfony/process from dist: The zip extension and unzip/7z commands are both missing, skipping."
I googled a bit and most of the answers were to use the command
" sudo apt-get install zip unzip php-zip ".
But I'm using windows and I can't find any answer relating to the issue.

答案1

得分: 49

我也遇到了同样的问题(Windows)。通过以下方式解决:

打开php.ini文件并取消注释;extension=zip,使其变为extension=zip

英文:

Had the same problem too (Windows). Fixed it by;

Open the php.ini file and uncomment ;extension=zip to extension=zip

答案2

得分: 5

从PHP 8.2.0版本开始,必须在php.ini中启用php_zip.dll DLL。此前,此扩展是内置的。

英文:

https://www.php.net/manual/en/zip.installation.php#zip.installation.new.windows:

As of PHP 8.2.0, php_zip.dll DLL must be enabled in php.ini. Previously, this extension was built-in.

答案3

得分: 2

所以,解决这个问题有三种方法:

  1. 正如@cmb和@OBrienEvance所提到的那样。

  2. 第二种方法是使用具有解压缩命令的'git bash'。

  3. 第三种方法是安装7zip或另一个压缩工具。

如果你使用的是最新的Windows 10或Windows 11,可以按照以下步骤进行操作:

在PowerShell中,

winget install 7zip.7zip

安装完成后,将其文件夹设置为环境变量,然后你可以在PowerShell或任何其他终端中使用7z命令。

英文:

So, there are three ways to solve this problem

  1. As mentioned by @cmb and @OBrienEvance.

  2. Second is to use 'git bash' that has unzip command.

  3. Third approach would be to install 7zip or another archiver

Here is how if you are on latest windows 10 or windows 11.

In PowerShell

> winget install 7zip.7zip

Set its folder as environment variable after this you can use 7z command in PowerShell or in any other terminal.

huangapple
  • 本文由 发表于 2023年1月9日 02:34:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75050370.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定