Fatal error: Allowed memory size of 134217728 bytes exhausted ... with a minimal code??

Topics: Developer Forum, User Forum
Oct 22, 2012 at 4:23 AM
Edited Oct 22, 2012 at 4:27 AM

hi all,

I just started testing the library with a very simple code and I got the error of memory exhausted... could someone tell me what I am doing wrong?

I am using the library with CodeIgniter framework, could be that a reason ?

 

<?php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');

/** Include PHPExcel */
require_once './Classes/PHPExcel.php';

class LoadCVS extends CI_Controller {

public function index() {

$fileXLS = "./XLS/ibex35.xls";

$objPHPExcel = PHPExcel_IOFactory::load($fileXLS);

}

}

 

I get the error

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 257 bytes) in /home/jose/Documents/Aptana Studio 3 Workspace/trendstocks/Classes/PHPExcel/Shared/String.php on line 576

If I use a simple PHP file as

 

<?php

require_once './Classes/PHPExcel.php';

// get the segment 1 , add extension.xsl and load the file (/XLS/name.xsl) into memory

$fileXLS = "./XLS/ibex35.xls";

$objPHPExcel = PHPExcel_IOFactory::load($fileXLS);

?>

 

 I get the error

Fatal error: Maximum execution time of 30 seconds exceeded in /home/jose/Documents/Aptana Studio 3 Workspace/trendstocks/Classes/PHPExcel/Reader/Excel5.php on line 889

 anyone could tell me what I am doing wrong?

 

Many thanks in advance.

Jose

 

Coordinator
Oct 23, 2012 at 10:12 PM

So how big is the file you're trying to load? How many worksheets/rows/columns/cells?

Oct 24, 2012 at 10:50 AM

hi Mark,

 

thanks for the reply. you are right, may be the file is too big. 7Mb. has 20 sheets with around 4000 rows of 5 columns each...

I tried with an excel file of 3 sheets and works fine... any idea how can I do to load bigger files?

 

thanks!

Coordinator
Oct 24, 2012 at 1:46 PM

It's what we created cell caching for... improved memory usage but at a cost in speed - described in the manual.