Laravel excel Class 'ZipArchive' not found
Asked Answered
B

3

5

I have laravel project with ability to upload data to mysql from .csv file using laravel-excel plugin.

When I try to upload data to mysql from .csv file, I get error "Class 'ZipArchive' not found". Can't understand what 'zip' has to do with it, if I use .csv I am using: VMware Debian server, PHP 7.1

Everything works fine on my PC, localhost.

Brunette answered 23/4, 2018 at 8:23 Comment(2)
your project could be using ZipArchive class , check your entire codebaseTelugu
Possible duplicate of Fatal error: Class 'ZipArchive' not found inTelugu
P
12

This happens when you have not installed the zip-extension.

you can install it like

sudo apt-get install php7.1-zip

after installing make sure restart the server.

Hope this helps.

Prudish answered 23/4, 2018 at 8:28 Comment(2)
How to do this on cpanel?Aryl
Solution works on Php 8.0 on cPanel. Just had to activate Zip module in "Php Selector" section.Jinnah
C
2

For MS Windows Users:

  1. Go to Xampp Server config file pannel php.ini.
  2. Change the line: ;extension=zip to extension=zip (Just remove the ; before extension=zip).
  3. Save php.ini.
  4. Restart Xampp Server.
Calvin answered 16/5, 2023 at 14:52 Comment(2)
and how did you know if he's using Xampp?Reilly
thanks for this solution. save my timeScalise
H
0

Laravel-excel uses Phpspreadsheet which has the php_zip extension as a requirement. If you're only using it for CSV parsing, are you sure you need the entire laravel-excel plugin?

The solution is to install php-zip on your debian server or use a different method of parsing your CSVs.

Hairless answered 23/4, 2018 at 8:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.