1

When I try to post a new forum topic getting this error

Fatal error: Allowed memory size of 157286400 bytes exhausted (tried to allocate 91 bytes) in /sai/vij/modules/field/field.attach.inc on line 696

i have a free space of 4389 MB in server. and I given a memory_size as -1 in php.info file.

     Any ideas for implementing this in drupal is appreciated.
  • 1
    You probably need to increase your PHP's memory_limit from 128M to 256M. If you're using C-Panel, I am sure there is an option for that somewhere. If you use SSH command line, then you just need to edit the PHP's php.ini file and remember to restart apache – No Sssweat Jan 6 '17 at 7:52
  • After increasing the memory limit to 256M, same error i am geeting. any help. – sai vijay Jan 6 '17 at 8:32
  • Are you sure the 256M has kicked in? Check your /admin/reports/status and see if it says 256M there. – No Sssweat Jan 6 '17 at 8:36
  • Thanks a lot!! sssweat, now i can able to do new posting in forum. i am new to drupal could you please help on this issue drupal.stackexchange.com/questions/224644/… – sai vijay Jan 6 '17 at 9:05
  • The answers already given there are good, you should try them out. – No Sssweat Jan 6 '17 at 9:12
1

Yes i think @No Sssweat is right. You need to increase PHP memory limit.

ini_set('memory_limit', '256M'); in your sites/default/settings.php file.

Increase PHP memory limit

Increase PHP's memory limit, e.g. to increase it to 256M you could try adding:

memory_limit = 256M to your server's main php.ini file (recommended, if you have access)
memory_limit = 256M to a php.ini file in the Drupal root
ini_set('memory_limit', '256M'); in your sites/default/settings.php file
php_value memory_limit 256M in your .htaccess file in the Drupal root
  • In your last code snippet are lines 3 and 4 other ways to do it? Because from my experience making the change in the php.ini file alone is enough. – No Sssweat Jan 6 '17 at 8:08
  • Thanks a lot!! smalution, now i can able to do new posting in forum. i am new to drupal could you please help on this issue drupal.stackexchange.com/questions/224644/… – sai vijay Jan 6 '17 at 9:08
  • 1
    Yes @No Sssweat I am agree by changing the memory limit on php.ini is enough. I just added different way to achieve same. Thank You :) – DRUPWAY Jan 6 '17 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.