4

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.

LinasM
  • 105
  • 1
  • 1
  • 7

3 Answers3

10

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.

FULL STACK DEV
  • 15,207
  • 5
  • 46
  • 66
1

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.
helvete
  • 2,455
  • 13
  • 33
  • 37
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.

Matt Peck
  • 24
  • 2