10

I'm trying to install maatwebsite/excel; however, I can't get it to work.

I tried deleting the composer.lock file and running:

composer install
composer update

I also tried:

composer require maatwebsite/excel --update-with-dependencies

Neither method worked.

The error I received was:

Problem 1
- maatwebsite/excel 3.1.10 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
- maatwebsite/excel 3.1.11 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
- maatwebsite/excel 3.1.12 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
- maatwebsite/excel 3.1.13 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
 .
 .
 .
 .

- maatwebsite/excel 3.1.14 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
- maatwebsite/excel 3.1.15 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].   
- Installation request for maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.1.16, 3.1.17, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.1.x-dev, 3.2.x-dev].

To enable extensions, verify that they are enabled in your .ini files:
- C:\Users\user\Downloads\php-7.3.8-nts-Win32-VC15-x64\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 to its original content.

7 Answers 7

13

Apparently, it was a dependency error. To ignore this dependency requirement run:

composer require maatwebsite/excel --ignore-platform-reqs
2
  • 2
    maatwebsite/excel 3.1.10 requires phpoffice/phpspreadsheet, so you should not require 'maatwebsite/excel', require 'phpoffice/phpspreadsheet' instead.
    – Ngoc Nam
    Commented Nov 29, 2019 at 5:18
  • Thanks you so much it work for me laravel 8
    – dihardmg
    Commented Apr 21, 2021 at 5:42
10
sudo apt-get install php-zip&&sudo apt-get install php-gd

it helped me

7

In my stuation, the error happened because composer wasn't able to load the phpoffice/phpspreadsheet package. Normally, composer is capable of installing dependencies. However, there were some missing php extension on the server – like php zip. Once I installed those extensions, the problem was solved.

Instead of ignoring requirements, I suggest you to look into the source of the problem.

1
  • 2
    This worked for me: composer require maatwebsite/excel -W (Which the [-W] means require all dependencies update)
    – Eben Watts
    Commented Aug 11, 2022 at 1:31
3

GD (GIF Draw) extension is required for this package. You need to enable the gd extension from php.ini file.

search for this file in php.ini: extension=gd

1
  • This is the real answer! Commented Nov 18, 2021 at 7:47
0

Go to your php.ini file and look for the line **;extension=gd** and change it to **extension=gd**

If this line is not there then look for **gd** only and un comment it.

0

I tried many things but this worked for me.

sudo apt-get install php-zip&&sudo apt-get install php-gd I was getting. maatwebsite/excel 3.1.10 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].

As Teoman Tıngır said Composer should update dependencies but sometime due to some missing extension it cannot be able to do that that's why these errors come up.

0

go to php.ini and uncomment(extension=gd) remove ; before extension=gd it helped me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.