Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.4

Bug #4247 crash with big excel files
Submitted: 2005-04-29 14:21 UTC
From: gonzalo123 at gmail dot com Assigned: chief
Status: Closed Package: Spreadsheet_Excel_Writer
PHP Version: 5.0.4 OS: Linux Suse 9.2
Roadmaps: (Not assigned)    
Subscription  


 [2005-04-29 14:21 UTC] gonzalo123 at gmail dot com
Description: ------------ When I try to generate very big files (more than 1.5Mb more or less) Spreadsheet_Excel_Writer allways return the same 2Mb(it looks like excel file but it is corrupt) Reproduce code: --------------- $workbook = new Spreadsheet_Excel_Writer(); for ($i;$i<=1000;$i++) { $worksheet =& $workbook->addWorksheet(); $worksheet->write(0, 0, "dummy"); for ($j;$j<=10000;$j++) $worksheet->write($i, $j, "dummy"); } $workbook->send('test.xls'); $workbook->close();

Comments

 [2005-04-29 14:53 UTC] gonzalo123 at gmail dot com
It works with PHP4
 [2005-04-29 16:47 UTC] gonzalo123 at gmail dot com
I have tried with the latest versions from CVS too
 [2005-04-30 09:04 UTC] tuupola
So the bug seems to be php5 only?
 [2005-04-30 11:51 UTC] gonzalo123 at gmail dot com
yes only with the latest php5. Exactly the same code with PHP4 works. with PHP5 works if the output excel file is <1.5 (more or less) but if it is bigger the output file allways is 2M (even if it is bigger) this 2Mb file looks like one exel file but it is impossible to open it with oO or msExcel. I have check the tmp folder and it is ok
 [2005-05-27 19:42 UTC] james at charity dot org
This bug is cross platform and does appear in PHP5 (4 seems fine). The bug only effects files that are sent directly to the web browser. Files that are generated to the file system, by specifying the file name, are fine. PHP5 itself does not have a problem passing excel spreadsheets through using the same headers as this module does (blank script reading a file and printing it out after the appropriate headers). I haven't been able to locate the issue within Excel Writer yet.
 [2006-02-21 11:40 UTC] chief at php dot net
Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR. Its a PHP 5.0.4 bug, not a Excel_Writer bug: http://bugs.php.net/bug.php?id=32553 Quick workaround: specify a file name in constructor. After closing workbook send it to user using while(echo fread(...))