Padheye.com : Discover Excellence

The Path To Discover Excellence.

Tuesday, 23 February 2016

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)

 Sometimes we get this php error on long page load or load many files are at once

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)

This is because of memory_limit parameter of php.

If you have sufficient RAM available on server your used you can change this parameter on php.ini

change this - 

memory_limit = 128M

TO

memory_limit = 1024M

usually on ubuntu php.ini is available at "/etc/php/7.x/apache/php.ini" or installation directory on server.

OR 

you can change it using ini_set function of php in your php files

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

 

Note:-

ini_set('memory_limit', '-1'); 

is also a way to sort the problem, but it will give unlimited memory available on server(-1 means).

 

Hope this wiil sort it out your error.

No comments:

Post a Comment