Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Uncaught exception 'Exception' in PHPExcel classes

Tags:

exception

php

Can any one please let me know, why this following error has been thrown from PHPExcel classes

    Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file
 /var/www/mydomain/myexcel.xlsx.' in /var/www/mydomain/Classes/PHPExcel/Writer
/Excel2007.php:400 Stack trace: #0 /var/www/mydomain/myexcel.php(173):
 PHPExcel_Writer_Excel2007->save('/var/www/mydomain...') #1 {main} 
thrown in /var/www/mydomain/Classes/PHPExcel/Writer/Excel2007.php on line 400
like image 514
Chakrapani Avatar asked Dec 13 '22 21:12

Chakrapani


2 Answers

I hope this exception may occur because of the Excel sheet is still in open state. also please check with the permission of the folder in which you write/save/upload the .xlsx file.

like image 111
Prabhu M Avatar answered May 13 '23 23:05

Prabhu M


My educated guess would be that this is due to the fact that the permissions on the folder you're trying to write to are wrong. If that's the case, either make the folder writable (which, from the looks of it would be a bad idea) - or try to save to a location where the web user has write access to solve the problem.

BTW What version of PHPExcel are you using?

like image 21
wimvds Avatar answered May 14 '23 00:05

wimvds