`Allowed memory size exhausted` error when reading large excel file

1.3k views Asked by At

I'm trying to read a large excel file using PHPExcel library. Even though I included these:

ini_set('memory_limit', '1024M');
ini_set('max_execution_time', '300');

but I'm still getting this error:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 234881024 bytes) in D:\xampp\htdocs\BidCrawler\application\third_party\PHPExcel\CachedObjectStorage\Memory.php on line 55

Any ideas?

1

There are 1 answers

0
LF-DevJourney On

Though you can enlarge the limit of your config, but for php webservice for multi users better not.

Use batch reading of a file, each time read a part then process it.