[英]error when installing the package on laravel via composer
作曲家需要 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.
您需要在php.ini
文件中启用gd
扩展。
那里有一行可能看起来像这样: ;extension=gd2
(或;extension=gd
),它需要是extension=gd2
(或extension=gd
)。
Laravel Server Requirements mention that BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer, and XML extensions are required. 大多数扩展都是默认安装和启用的。
您可以在 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.