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.
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 !
Increase memory limit in php.ini
, this is not is appropriate solution at all.
this case can be also occurred from code e.g infinite loop, process large amount data, or even database queries You should check code, there might have been infinite loop or such type case.
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
The error is obvious and it is due to exceeding memory limits by setting in your ini files or .htaccess. You can also set via php as Anubhay wrote. Following variables are your concern
php_value post_max_size 1000M
php_value upload_max_filesize 2500M
php_value max_execution_time 6000000
php_value max_input_time 6000000
php_value memory_limit 2500M
You can optimize query data by using cake behavior containable. It is better practice to optimize your code/data rather than increasing memory size.
Thanks
Try...
Allowed memory size
ini_set('memory_limit', '-1');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With