How to fix memory getting exhausted with PHPExcel?

Viewed 62097

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1078799 bytes) in D:\xampplite\htdocs\Scraper\PHPExcel\Reader\Excel2007.php on line 269

My 128M PHP memory limit quickly gets exhausted even when I am only trying to open a small excel file of ~350 KB with PHPExcel.

Although, I can increase the memory limit in the configuration but it'll be great to see if there are any alternatives to fix this.

8 Answers

This post talks about how to close a PHPExcel reader: How to close excel file in php-excel-reader If you're opening multiple Excel files simultaneously, but actually not need them all at the same time, then you could try to open and close(i.e. unset) the readers for each file one by one. Btw, using the same variable name for readers would suffice for the "unsetting" operation.

Related