0

Using maatwebsite/excel package to import excel files to the app. CSV imports work properly but when I try importing XLSX(Excel) files, I get this error "Class "ZipArchive" not found".

I also checked the php modules, I have zip module installed.

What could be the issue ?

1 Answers1

-1

The error "Class 'ZipArchive' not found" usually occurs when the ZipArchive class is not available or not enabled in PHP. Although you mentioned that you have the zip module installed, it's possible that the module is not enabled for the PHP CLI (Command Line Interface) which is used by Laravel's artisan commands.

Run the following command in your terminal or command prompt:

php -m | grep zip

If it doesn't show any output or returns an error, it means the zip module is not enabled. In that case, you need to enable it.

Locate your PHP configuration file (php.ini). The location of this file can vary depending on your operating system and PHP installation. Open the php.ini file in a text editor and search for the following line:

;extension=zip

Remove the semicolon (;) at the beginning of the line to uncomment it:

extension=zip

Save the changes to php.ini and restart your web server and/or PHP CLI.

hjolfaei
  • 112
  • 5