CakePHP : Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 52 bytes)

Asfaq Tamim picture Asfaq Tamim · Dec 18, 2013 · Viewed 31.7k times · Source

Hi i have a apps running on CakePHP v 1.3. I've updated my wamp server to v2.4.After updating i got this error message.I did these changes into my php.ini settings.


  • memory_limit = 128M
  • file_uploads = ON
  • upload_max_filesize = 128M
  • max_input_time
  • max_execution_time = 300
  • post_max_size = 128M
  • realpath_cache_size = 16k
  • realpath_cache_ttl = 120

But i'm still getting these Error message :

CakePHP : Fatal error: Allowed memory size of 536870912 bytes exhausted 
(tried to allocate 52 bytes) in C:\wamp\www\gtgcrm\cake\libs\model\
datasources\dbo\dbo_mysql.php on line 775

What i missed ? Any Suggestion will be appreciated !

Answer

Anubhav picture Anubhav · Dec 18, 2013

You can increase memory limit by using in your controller action

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

Also you can increase time out limit

set_time_limit(0); Infinite