Fatal error: Exception exception thrown in PHPExcel classes

Can someone please let me know why this next error was selected 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 
+4
source share
5 answers

I hope this exception may occur because the Excel worksheet is still in the open state. also consult the permission of the folder where you write / save / load the .xlsx file.

+4
source

As I understand it, this is because the rights to the folder you are trying to write are wrong. If this happens, either make the folder writable (which in appearance would be a bad idea), or try to save it in the place where the web user has write access to solve the problem.

BTW What version of PHPExcel are you using?

+4
source

The most likely cause of this error is that you do not have permission to write to the directory in which you are trying to save the Excel file.

+4
source

An exception is thrown because PHPExcel opened a zip file for writing an Excel workbook; but when he tries to close it again upon completion, the call to the zip library method for the close () function failed. Why this failed is a real problem and it is impossible to solve just knowing the error message.

+1
source

I had the same problem - this is how I solved it: Traditionally, PHP works as a web server daemon, so it would be reasonable that the web server daemon would have to write in this subdirectory and should be the owner of the group of all subdir examples. I made this simple change and it worked perfectly.

0
source

Source: https://habr.com/ru/post/1310196/


All Articles