0

I have successfully implemented uploading Excel files to my database using phpexcel library. It's working perfectly on localhost but when tested in live server I got this error.

Fatal error: Class 'ZipArchive' not found in /xxxx/PHPExcel-develop/Classes/PHPExcel/Reader/Excel2007.php .

I have found a solution on this question: PHPExcel ZipArchive not found but it's not helping me.

I know ZIP extention has to enabled using this line of code

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

But I don't know where to use this code in the excel library. Also I don't have direct access to root server.

Community
  • 1
  • 1
Blessan Kurien
  • 1,645
  • 9
  • 31
  • 63

1 Answers1

3

You need to add

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

right after the line

require_once 'path/to/PHPExcel.php';

or before any instanciation of the PHPExcel class.

Benjamin C.
  • 1,076
  • 12
  • 20