0
votes

I am using PHPExcel lib for generating excel file of a table of mysql database. But I m getting a fatal error when i call a function for excel generation. The error which is comming is given below.

Fatal error: Uncaught exception 'Exception' 
with message 'Could not close zip file DfEeFxMeVtUnSbKoEpTpYdYiYsEnGrQi.xlsx.' 
in /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/PHPExcel/Writer/Excel2007.php:337 

Stack trace: 
#0 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/class.IExportModule.php(81): PHPExcel_Writer_Excel2007->save('DfEeFxMeVtUnSbK...') 
#1 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/class.ExportModule_lang.php(59): IExportModule->_download_Excel2007() 
#2 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/controllers/export.get.create.php(12): ExportModule_lang->export() 
#3 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/export.php(17): require_once('/home/testcente...') 
#4 {main} thrown in /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/PHPExcel/Writer/Excel2007.php on line 337

hello friends please tell me why this error occurred and how can we fix this error?

1
Can you post some code? It seems to me that you have some problem like bad access rights on the folder where the file gets zipped. - cypher
use phpinfo(); and see that zlib is enabled or not?? - diEcho

1 Answers

0
votes

from the PHPEXCEL Reference

Requirements

  • PHP version 5.2.0 or higher
  • PHP extension php_zip enabled **
  • PHP extension php_xml enabled
  • PHP extension php_gd2 enabled (if not compiled in)

All part of the PHP package (zip) on http://www.php.net/downloads.php, should be enabled in php.ini

** php_zip is only needed by PHPExcel_Reader_Excel2007, PHPExcel_Writer_Excel2007, PHPExcel_Reader_OOCalc. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not.