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 ?
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:
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 thephp.inifile in a text editor and search for the following line:Remove the semicolon (;) at the beginning of the line to uncomment it:
Save the changes to
php.iniand restart your web server and/or PHP CLI.