Php 通过composer在laravel上安装程序包时出错

Php 通过composer在laravel上安装程序包时出错,php,excel,laravel,package,Php,Excel,Laravel,Package,编写器需要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 - maat

编写器需要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
文件中启用th
gd
扩展名

里面有一行可能是这样的:
;extension=gd2
(或
;extension=gd
),它必须是
extension=gd2
(或
extension=gd
)。

提到BCMath、Ctype、JSON、Mbstring、OpenSSL、PDO、标记器和XML扩展是必需的。默认情况下,大多数扩展都已安装并启用

您可以在Ubuntu中运行以下命令,以确保已安装扩展

sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip
特定于PHP版本的安装(如果安装了PHP 7.4)

要了解如何在windows上安装,请访问:

sudo apt install php7.4-common php7.4-bcmath openssl php7.4-json php7.4-mbstring