The problem is about Laravel Excel requirements. It seems PhpSpreadsheet: ^1.15 is not installed. Here is the list of requirements for Laravel-Excel 3.1,
I just want share another answer related here. If you run on unix (linux), try install php-gd using command line. Try check other answer related to your system.
This problem happen only on php 8.x! perhaps on lastest php 7. The problem same as above and still failed even php-gd is active. When type
composer require maatwebsite/excel
the error still the same. When checking using
php -i
(basicly same as phpinfo in console). We can see php gd is active. This answer is not recommended at the moment. Fixed still on the way related to this issue.
I solved using
Enable zip and gd extension in php.ini
or install using sudo apt-get install php8.0-gd
sudo apt-get install php8.0-zip
use composer require maatwebsite/excel:^3.1 -W
-W is for with-all-dependencies
7
Answers
I solved the problem with
gd extension
fromphp.ini
filePhpSpreadsheet
The problem is about Laravel Excel requirements. It seems
PhpSpreadsheet: ^1.15
is not installed. Here is the list of requirements for Laravel-Excel 3.1,Make sure these are installed and enabled on your
php.ini
. Also make sure your php version oncomposer.json
is set like this:Instead of something like this
"php": ">=7.2"
. Check this out for more information. Please let me know if it worked.I just want share another answer related here. If you run on unix (linux), try install php-gd using command line. Try check other answer related to your system.
related:
How to install PHP GD in Ubuntu
install php-gd ext on Debian
Issue with enabling GD in PHP
If you using windows. Use this command.
This problem happen only on php 8.x! perhaps on lastest php 7. The problem same as above and still failed even php-gd is active. When type
the error still the same. When checking using
(basicly same as phpinfo in console). We can see php gd is active. This answer is not recommended at the moment. Fixed still on the way related to this issue.
related link:
https://github.com/Maatwebsite/Laravel-Excel/discussions/3191
PHP8 is supported, make sure to use 3.1.30 of the package as mention above. To see other issue, please read this link.
https://github.com/Maatwebsite/Laravel-Excel/issues/2936
delete composer.lock (json)
then run below command
composer require phpoffice/phpspreadsheet
composer require maatwebsite/excel
it is working
I solved using
Enable zip and gd extension in php.ini
or install using sudo apt-get install php8.0-gd
sudo apt-get install php8.0-zip
use composer require maatwebsite/excel:^3.1 -W
-W is for with-all-dependencies
I have just used
composer require maatwebsite/excel -W --ignore-platform-req=ext-zip
and this has worked for me on linux ubuntu 20 with php 8.1I used this command from composer tips and this my case is solved:
"composer require maatwebsite/excel:*"