Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

priyalaks's avatar

Trying to install maatwebsite/excel:^2.1

Trying to install maatwebsite/excel:^2.1 . But facing the below error. My laravel version is 9 ?

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires maatwebsite/excel 2.1 -> satisfiable by maatwebsite/excel[v2.1.0].
    - maatwebsite/excel v2.1.0 requires illuminate/cache 5.0.*|5.1.*|5.2.* -> found illuminate/cache[v5.0.0, ..., 5.2.x-dev] but these were not loaded, likely because it conflicts with another require.


Installation failed, reverting ./composer.json and ./composer.lock to their original content.

First I tried to install composer require psr/simple-cache:^2.0 And then ran the composer instal for maatwebsite/excel. But still no luck .

Any possible solution for this issue . ? Also can some one advise if the maatwebsite package are efficient ones for Excel import and export ? Pls Suggest me any other good packages if any .

0 likes
10 replies
tykus's avatar

Why are you trying to install that specific version of maatwebsite/excel? The latest version (3.1) supports Laravel 9

priyalaks's avatar

The latest version threw the below error . So i thought of decrementing the version.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - maatwebsite/excel[3.1.36, ..., 3.1.x-dev] require phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0, ..., 1.24.1].
    - maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.1.6) does not satisfy that requirement.
    - maatwebsite/excel[3.1.26, ..., 3.1.35] require illuminate/support 5.8.*|^6.0|^7.0|^8.0 -> found illuminate/support[v5.8.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - phpoffice/phpspreadsheet[1.18.0, ..., 1.24.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.1.x-dev].

To enable extensions, verify that they are enabled in your .ini files:
    - D:\xamp\php\php.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 need.
Sinnbeck's avatar

You need to install the gd extension

phpoffice/phpspreadsheet[1.18.0, ..., 1.24.1] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.

tykus's avatar

@priyalaks The list of requirements are here - the PHPSpreadsheet issue should be solved by installing the Simple Cache dependency. I don't know why the Excel package is fixing on the php ^7.0 requirement - since its composer.json clearly supports php ^8.0 also. Similarly, for illuminate/support 5.8.*|^6.0|^7.0|^8.0 - as the composer.json has ^9.0 as a dependency also "illuminate/support": "5.8.*|^6.0|^7.0|^8.0|^9.0". How are you trying to install the dependency?

composer require psr/simple-cache:^1.0 maatwebsite/excel

https://docs.laravel-excel.com/3.1/getting-started/installation.html

priyalaks's avatar

@Sinnbeck I am unable to install the ext-gd either . It threw me the below error . So I tried to check in the php ini file for ext-gd - and there is no such entry.

composer require "ext-gd:*"
./composer.json has been updated
Running composer update ext-gd
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires PHP extension ext-gd * but it is missing from your system. Install or enable PHP's gd extension.

To enable extensions, verify that they are enabled in your .ini files:
    - D:\xamp\php\php.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.
priyalaks's avatar

@tykus Yes I am trying to follow the steps in the link you provided but facing the issue .

Sinnbeck's avatar

@priyalaks Then search around the web to see if you can find a different guide :) I just picked the first I found. When the message is gone, it should be installed

And just check the file for anything called gd. It probably wont have ext- in the name

priyalaks's avatar

@Sinnbeck Thanks much . I was searching for 'ext' instead of 'extension' Followed the link and it worked. Thanks again.

Please or to participate in this conversation.