Abd*_*dul 19 macos laravel composer-php macos-catalina
我正在尝试运行作曲家更新,出现以下错误
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].
Run Code Online (Sandbox Code Playgroud)
when running作曲家更新`
一夜之间,我犯了我一生的错误,并允许我的Mac自动更新OS。所以我现在在macOS Catalina中。
我尝试添加
"require": {
"ext-zip": "*",}
Run Code Online (Sandbox Code Playgroud)
到我的composer.json ..,但没有下载该扩展名。
我现在如何运行作曲家更新,将对您有所帮助。
小智 51
将Mac更新到Catalina之后,我遇到了同样的问题。这对我有用。
brew update
brew install php@7.3
brew link php@7.3
Run Code Online (Sandbox Code Playgroud)
然后重新加载控制台。
它将安装带有zip模块的php 7.3.10。您可以使用php -v检查版本,并使用php -m查看模块。
Ham*_*eed 37
以下命令修复了 macOS Catalina 上的问题
brew link php@7.3 --force
Run Code Online (Sandbox Code Playgroud)
小智 18
2020 年 3 月 10 日,它对我有用:
brew install php
Run Code Online (Sandbox Code Playgroud)
这是关于 PHP 的唯一一个有效的命令。所以,我认为上一篇文章中显示的命令已被弃用。
小智 16
如果 brew 链接对您不起作用,请检查您安装的 php 版本:
ls /usr/local/opt/php*
Run Code Online (Sandbox Code Playgroud)
在这里,您将看到一个版本:
/usr/local/opt/php@7.3/bin:$PATH
Run Code Online (Sandbox Code Playgroud)
应该给你一个输出,如:
/usr/local/opt/php@7.3:
INSTALL_RECEIPT.json include
LICENSE lib
NEWS pecl
README.md sbin
bin share
homebrew.mxcl.php@7.3.plist
Run Code Online (Sandbox Code Playgroud)
现在您只需要将其链接到您的 $PATH 即可,如下所示:
echo 'export PATH="/usr/local/opt/php@7.3/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@7.3/sbin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Run Code Online (Sandbox Code Playgroud)
注意:我使用 .zshrc 因为这是我的终端设置。如果您使用的是 bash,请相应地使用。
您可以通过运行以下命令来检查哪个版本的 php 现在链接到您的 MacOS:
which php
Run Code Online (Sandbox Code Playgroud)
这应该给你一个输出:
/usr/local/opt/php@7.3/bin/php
Run Code Online (Sandbox Code Playgroud)
就是这样。现在,如果您尝试 composer update,它不应该给您扩展问题。
来源(部分):https : //medium.com/@jjdanek/installing-php-extensions-on-mac-after-homebrew-acfddd6be602
bsc*_*hen 15
就像@marc-alexander 所说的那样,这是一种不好的做法。--ignore-platform-reqs如果您不确定自己在做什么,则不应使用option。
我认为该选项会忽略平台要求并安装特定版本的软件包。但实际上它会忽略平台要求并安装最高可用版本的软件包。
所以如果你需要缺少的 PHP 扩展,你应该安装(或启用)它
参考:ignore-platform-reqs 安装 dev-master 而不是正确的版本
如果您不需要ext-zip(例如,您只想做一些快速修复),您可以使用--ignore-platform-reqs选项忽略要求:
$ composer update --ignore-platform-reqs
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7529 次 |
| 最近记录: |