为 Mac 安装 ext-zip [英] install ext-zip for Mac

查看:65
本文介绍了为 Mac 安装 ext-zip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行 composer update,但出现以下错误:

I am trying to run composer update and I get the following errors:

Problem 1
    - The requested PHP extension ext-zip * is missing from your system. Install or enable PHP's zip extension.
  Problem 2
    - maatwebsite/excel 3.1.10 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.11 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.12 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.13 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.14 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.15 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.16 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.17 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.7 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.8 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.9 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.x-dev requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.2.x-dev requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.0 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.1 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.2 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.3 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.4 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.5 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - maatwebsite/excel 3.1.6 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
    - phpoffice/phpspreadsheet 1.9.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.8.2 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.8.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.8.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.7.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.6.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.5.2 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.5.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.5.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.4.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for maatwebsite/excel ^3.1.0 -> satisfiable by maatwebsite/excel[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.1.16, 3.1.17, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.1.x-dev, 3.2.x-dev].

运行时composer update

一夜之间我犯了我一生的错误,让我的 Mac 自动更新操作系统,所以我现在在 macOS Catalina.

Overnight I have made the mistake of my life and allowed my Mac to automatically update the OS, so I am in macOS Catalina now.

我已经尝试添加

 "require": {
    "ext-zip": "*",
 }

到我的 composer.json.. 但它没有下载那个扩展.

to my composer.json..but its not downloading that extension.

推荐答案

将 Mac 更新为 Catalina 后,我遇到了同样的问题.这对我有用.

I had the same problem after updating my Mac to Catalina. Here is what worked for me.

brew update
brew install php@7.3
brew link php@7.3

然后重新加载您的控制台.

Then reload your console.

它将安装带有 zip 模块的 php 7.3.10.您可以使用 php -v 检查版本,使用 php -m 检查模块.

It will install php 7.3.10 with zip module. You can use php -v to check for the version, and php -m for the modules.

这篇关于为 Mac 安装 ext-zip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆