skip to Main Content

I have face this problem to install maatwebsite/excel on laravel 8. How can I fix it?
NB: PHP version running 8.
Problem Screen shoot

7

Answers


  1. Chosen as BEST ANSWER

    I solved the problem with

    1. I just enable PHP gd extension from php.ini file
    2. installing PHP package PhpSpreadsheet

  2. 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,

    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 your php.ini. Also make sure your php version on composer.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.

    Login or Signup to reply.
  3. 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

    install php-gd ext on Debian

    Issue with enabling GD in PHP

    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.

    https://github.com/Maatwebsite/Laravel-Excel/issues/2936

    Login or Signup to reply.
    1. delete composer.lock (json)
      then run below command

    2. composer require phpoffice/phpspreadsheet

    3. composer require maatwebsite/excel

    it is working

    Login or Signup to reply.
  4. 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

    Login or Signup to reply.
  5. 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.1

    Login or Signup to reply.
  6. I used this command from composer tips and this my case is solved:
    "composer require maatwebsite/excel:*"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search