Die Installation von maatwebsite/excel ist fehlgeschlagen
P粉819937486
P粉819937486 2024-01-28 19:40:36
0
1
508

Ich möchte maatwebsite/excel installieren und habe mehrere Methoden ohne Erfolg ausprobiert. Kann mir jemand helfen. Ich verwende Laravel v 9 und PHP v 8.1

> Gymnastiar@LAPTOP-NEA31346 MINGW64
> ~/Documents/Gymnastiar/Project/YamahaL8 $ composer require
> 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 Your requirements could not be
> resolved to an installable set of packages.
> 
>   Problem 1
>     - maatwebsite/excel[3.1.28, ..., 3.1.30] require phpoffice/phpspreadsheet 1.16.* -> satisfiable by
> phpoffice/phpspreadsheet[1.16.0].
>     - maatwebsite/excel[3.1.31, ..., 3.1.x-dev] require phpoffice/phpspreadsheet ^1.18 -> satisfiable by
> phpoffice/phpspreadsheet[1.18.0, ..., 1.24.0].
>     - maatwebsite/excel 3.1.27 requires phpoffice/phpspreadsheet ^1.16 -> satisfiable by phpoffice/phpspreadsheet[1.16.0, ..., 1.24.0].
>     - maatwebsite/excel 3.1.26 requires phpoffice/phpspreadsheet ^1.15 -> satisfiable by phpoffice/phpspreadsheet[1.15.0, ..., 1.24.0].
>     - maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.1.6) does not satisfy that requirement.
>     - phpoffice/phpspreadsheet[1.15.0, ..., 1.24.0] 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.1.x-dev].
> 
> To enable extensions, verify that they are enabled in your .ini files:
>     - C:xamppphpphp.ini You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can
> run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore
> these required extensions. You can also try re-running composer
> require with an explicit version constraint, e.g. "composer require
> maatwebsite/excel:*" to figure out if any version is installable, or
> "composer require maatwebsite/excel:^2.1" if you know which you ne


P粉819937486
P粉819937486

Antworte allen(1)
P粉106301763
  1. 转到 C:\xampp\php 中的 php.ini 文件
  2. 搜索此;extension=gd
  3. 删除;然后重新启动xampp
  4. "maatwebsite/excel": "^3.0" 添加到 composer.json 文件中的 "require"
  5. 运行composer更新自定义网站/excel

编辑: 对于那些在 Ubuntu-Debain 操作系统上遇到此问题的人,只需运行以下命令来安装 php-gd 扩展:

sudo apt-get install php8.1-gd // for php8.1
sudo apt-get install php8.2-gd // for php8.2
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!