Home > Administration, Info.Tech, Web Development > PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 4800 bytes)

PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 4800 bytes)

February 9th, 2009

When I first encountered this error, I thought something wrong with my apache-php integration. Thank God it’s not the one I thought.

This PHP Fatal error message will be encountered if your PHP script memory requirements exceed the default 8MB limit. Somehow, you can overcome this by doing two methods.

1. Set Resource Limits in /etc/php.ini

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 45 ; Maximum execution time of each script
max_input_time = 60 ; Maximum amount may spend parsing request data
memory_limit = 12M ; Maximum amount of memory a script may consume (8MB)

2. Initiate a function to set the Resources Limit

ini_set("memory_limit","12M");

Why so serious?!? that’s it… your done! :)

Camilo III Administration, Info.Tech, Web Development , , , , , , ,

  1. No comments yet.
  1. No trackbacks yet.