php - 通过composer在laravel上安装包时出错
问题描述
作曲家需要 maatwebsite/excel
Using version ^3.1 for maatwebsite/excel
./composer.json has been updated
Running composer update maatwebsite/excel
Loading composer repositories with package information
Updating dependencies
您的要求无法解决为一组可安装的软件包。问题 1
- maatwebsite/excel[3.1.27, ..., 3.2.x-dev] require phpoffice/phpspreadsheet ^1.16 -> satisfiable by phpoffice/phpspreadsheet[1.16.0, 1.17.0, 1.17.1].
- maatwebsite/excel 3.1.26 requires phpoffice/phpspreadsheet ^1.15 -> satisfiable by phpoffice/phpspreadsheet[1.15.0, 1.16.0, 1.17.0, 1.17.1].
- maatwebsite/excel[3.1.28, ..., 3.1.x-dev] require phpoffice/phpspreadsheet 1.16.* -> satisfiable by phpoffice/phpspreadsheet[1.16.0].
- maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.0.5) does not satisfy that requirement.
- phpoffice/phpspreadsheet[1.15.0, ..., 1.17.1] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
- Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.2.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
解决方案
Laravel 服务器要求提到需要 BCMath、Ctype、JSON、Mbstring、OpenSSL、PDO、Tokenizer 和 XML 扩展。大多数扩展都是默认安装和启用的。
您可以在 Ubuntu 中运行以下命令以确保已安装扩展。
sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip
特定于 PHP 版本的安装(如果安装了 PHP 7.4)
sudo apt install php7.4-common php7.4-bcmath openssl php7.4-json php7.4-mbstring
要查看如何在 Windows 上安装它,请访问:PHP gd extension install on windows
推荐阅读
- ios - statusCode 应该是 2xx,但在 swift 中是 400
- numpy - Keras 模型形状不兼容 / ValueError: Shapes (None, 3) 和 (None, 3, 3) 不兼容
- php - 在 AWS 服务器上安装 MySQLi
- reactjs - 创建 react 应用程序和工作箱 offline.html 食谱
- java - 闪光效果不适用于高度 wrap_content
- php - 如何使用 TCPDF 和 PHP 使数字签名在 pdf 中可见?
- python-xarray - 如何从两个 xarray 时间序列数据集中删除不匹配的时间序列
- openssl - Slated__ 使用换行打开 SSL?和密码说明?
- shiro - 会话在 SessionListenerAdapter 中过期后重定向到登录页面
- angular - 单击谷歌图表(饼图)切片时显示模式