1

AAm using "maatwebsite/excel": "^2.1" to import data from an excel fuile but it fails with an error

"message": "Class 'ZipArchive' not found",

I have

 $data = Excel::load('storage/app/temporary'.'/'.$request->input('file'))->get();

   var_dump($data);

Then am getting an error

 "message": "Class 'ZipArchive' not found",

Where am I going wrong?

I have imported

use Maatwebsite\Excel\Facades\Excel;

I have tried adding

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

but now gets an error

PclZip has a deprecated constructor in /home/geowan/Desktop/apps/laravel/importapi/

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip/pclzip.lib.php on line 190

Cœur
  • 37,241
  • 25
  • 195
  • 267
Geoff
  • 6,277
  • 23
  • 87
  • 197
  • 1
    https://stackoverflow.com/questions/3872555/fatal-error-class-ziparchive-not-found-in – Alexey Mezenin Jan 22 '18 at 16:32
  • 2
    Possible duplicate of [Fatal error: Class 'ZipArchive' not found in](https://stackoverflow.com/questions/3872555/fatal-error-class-ziparchive-not-found-in) – YouneL Jan 22 '18 at 16:34

1 Answers1

2

If you would like to use ZipArchive, you would have to install the PHP zip extension.

You can find more info on how to install it here.

Tosho Trajanov
  • 790
  • 8
  • 19