I have face a problem to install maatwebsite/excel on laravel 8 | php 8?
Get the solution ↓↓↓I have face this problem to install maatwebsite/excel on laravel 8. How can I fix it? NB: PHP version running 8.
Answer
Solution:
I solved the problem with
- I just enable PHP
gd extension
fromphp.ini
file - installing PHP package
PhpSpreadsheet
Answer
Solution:
The problem is about Laravel Excel requirements. It seemsPhpSpreadsheet: ^1.15
is not installed. Here is the list of requirements for Laravel-Excel 3.1,
PHP: ^7.2\|^8.0
Laravel: ^5.8
PhpSpreadsheet: ^1.15
PHP extension php_zip enabled
PHP extension php_xml enabled
PHP extension php_gd2 enabled
PHP extension php_iconv enabled
PHP extension php_simplexml enabled
PHP extension php_xmlreader enabled
PHP extension php_zlib enabled
Make sure these are installed and enabled on yourphp.ini
. Also make sure your php version oncomposer.json
is set like this:
"require": {
"php": "^7.2|^8.0",
},
Instead of something like this"php": ">=7.2"
. Check this out for more information. Please let me know if it worked.
Answer
Solution:
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.
sudo apt-get update
sudo apt-get install php8.0-gd
related:
How to install PHP GD in Ubuntu
If you using windows. Use this command.
composer require maatwebsite/excel --ignore-platform-reqs
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.
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.
Answer
Solution:
delete composer.lock (json) then run below command
composer require phpoffice/phpspreadsheet
composer require maatwebsite/excel
it is working
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: call to a member function store() on null
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.