Strange error message

Topics: Developer Forum, User Forum
Sep 9, 2008 at 2:33 PM
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 456 bytes) in ...libraries\PHPExcel\Cell\DataType.php on line 126

But there is no line number in this file!

And import was working!

error_reporting(E_ALL ^ E_NOTICE);
        $objReader = new PHPExcel_Reader_Excel5();
        $objReader->setReadDataOnly(TRUE);
        $this->objPHPExcel = $objReader->load($fileName);
Sep 9, 2008 at 3:13 PM
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 264 bytes) in D:\xampp\htdocs\myapp\libraries\PHPExcel\Cell.php on line 770

XAMPP or WampServer for WinXP SP3
Sep 9, 2008 at 3:26 PM
9    3.9370    33550024    PHPExcel_Worksheet->setCellValueByColumnAndRow( )    ..\Excel5.php:1315
10    3.9370    33550192    PHPExcel_Worksheet->setCellValue( )    ..\Worksheet.php:700
11    3.9370    33550192    PHPExcel_Worksheet->getCell( )    ..\Worksheet.php:688
Sep 9, 2008 at 3:29 PM
Can you add this method:

loadSheetByName/loadsheetByIndex to parse only needed sheets and not all!
Sep 9, 2008 at 7:07 PM
Is there possible to create standalone Worksheet object without linking to Workbook?
PS. Are memory requirements for loading CSV file the same as for Excel5 with OnlyData?
Developer
Sep 9, 2008 at 9:24 PM
Hmm... I have no explanation for your strange error message. Option for reading only the needed sheets may be the solution.
http://www.codeplex.com/PHPExcel/WorkItem/View.aspx?WorkItemId=7557
Sep 10, 2008 at 8:13 AM
memory not enough;@ini_set("memory_limit","50M");/*50M or more*/
Sep 10, 2008 at 6:39 PM
memory and time limit can not help.

Solution (I think the best and may be the only for data loading from Excel file):

Save all sheet as CSV files to ZIP (Macro for Excel / Calc needed), upload to server and parse using
http://de2.php.net/fgetcsv (see also comments)

This is much more faster and without memory overhead.