1

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

voromax
  • 3,369
  • 2
  • 30
  • 53
Dimas Adi Andrea
  • 443
  • 3
  • 11
  • 25
  • overwrite the memory allocation ini_set('memory_limit','xxx'); – JYoThI Aug 29 '16 at 07:12
  • in where? and what is the full code? – Dimas Adi Andrea Aug 29 '16 at 07:14
  • or find the memory limit in your php ini file and overwrite it with high value what you required – JYoThI Aug 29 '16 at 07:17
  • 1
    Possible duplicate of [Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)](http://stackoverflow.com/questions/561066/fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter-xml) – Abdulla Nilam Aug 29 '16 at 07:30
  • 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 Aug 29 '16 at 09:40

2 Answers2

1

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.
Raj Jagani
  • 738
  • 1
  • 6
  • 21
0

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.

Mcfaith
  • 269
  • 4
  • 16