I am using phpexcel to write quite a large excel file.
I am writing it from an array that looks like
array(
[0] => stdClass Object
(
[sent] => Mar 31st, 2011 02:10PM
[to_number] => 64211111111
[additional_txt] =>
[misc_data] =>
)
...
[14058] => stdClass Object
(
[sent] => Mar 31st, 2011 02:10PM
[to_number] => 64211111111
[additional_txt] =>
[misc_data] =>
)
)
The loop is
$r = 0;
foreach ($replies_obj as $row) {
$c = 'A';
foreach ($row as $col)
$xlsx->getActiveSheet()->setCellValue($c++ . $r, $col);
$r++;
}
and the error is
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 105 bytes) in /home/webspace/xxxx/test/htdocs/application/libraries/PHPExcel/Worksheet.php on line 961
Is this a phpexcel problem or am I doing something wrong?
How can I fix this?
There's a lot been written about PHPExcel and memory use, and I'm not going to repeat it all here.
Try reading some of the threads on the PHPExcel discussion board discussing the issue, such as this one; or previous answers here on SO such as this one or this one
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With