1
votes

How to fix this error in PHPExcel CodeIgniter?

Fatal error:

Allowed memory size of 134217728 bytes exhausted (tried to allocate 131072 bytes) in /sites/apps/seller/www/application/libraries/Excel/PHPExcel/CachedObjectStorage/CacheBase.php on line 173

2
overwrite the memory allocation ini_set('memory_limit','xxx'); - JYoThI
in where? and what is the full code? - Dimas Adi Andrea
or find the memory limit in your php ini file and overwrite it with high value what you required - JYoThI
Have you tried using any of the documented methods for reducing memory usage in PHPExcel, such as cell caching? Read the documentation for PHPExcel, look at the Examples, and you'll find out a lot of useful information - Mark Baker

2 Answers

1
votes

There are two ways to solve this error.

  1. Put the below code into your function at the beginning of the code.

ini_set('memory_limit', '2048M');

  1. You can find the php.ini file in your system and find the memory_limit and change its value and restart your server.
0
votes

Go to your XAMMP location and open PHP folder find php.init file and changes this

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
  memory_limit=128M
  to 
  memory_limit=150M

I hope this help.