{"id":57,"date":"2020-01-17T05:37:00","date_gmt":"2020-01-17T05:37:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=57"},"modified":"2020-11-29T19:30:26","modified_gmt":"2020-11-29T19:30:26","slug":"fatal-error-allowed-memory-size-exhausted","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/fatal-error-allowed-memory-size-exhausted\/","title":{"rendered":"Fatal error: Allowed memory size exhausted"},"content":{"rendered":"\n<p>Drupal can be very memory intensive CMS, especially if you have lots of menus, blocks and modules. If you exhaust the allowed memory size, you would get an error such as the following<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 41 bytes) in somefile<\/code><\/pre>\n\n\n\n<p>To fix this problem, you need to allocate more memory.<\/p>\n\n\n\n<p><strong>1. Open you php.ini file<\/strong>&nbsp;If you don&#8217;t know where this file is, run locate php.ini. Mine is located at \/etc\/php.ini. Make sure you back up this file before editing it.<\/p>\n\n\n\n<p><strong>1. Open you php.ini file<\/strong>&nbsp;If you don&#8217;t know where this file is, run locate php.ini. Mine is located at \/etc\/php.ini. Make sure you back up this file before editing it.<\/p>\n\n\n\n<p><strong>2. set memory_limit to 32M<\/strong>&nbsp;Find memory_limit and modify 16M to 32M. You can choose more if you think you would need more memory.<\/p>\n\n\n\n<p><strong>3. restart apache<\/strong>&nbsp;\/sbin\/service httpd restart<\/p>\n\n\n\n<p><strong>4. insert a line in settings.php<\/strong>&nbsp;Edit sites\/default\/settings.php inside your drupal directory. Insert the following line.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ini_set('memory_limit', '32M');<\/code><\/pre>\n\n\n\n<p>If this doesn&#8217;t work try using 64M or more. If you program is taking too much memory, you should check to see if it is coded properly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Drupal can be very memory intensive CMS, especially if you have lots of menus, blocks and modules. If you exhaust the allowed memory size, you would get an error such as the following To fix this problem, you need to allocate more memory. 1. Open you php.ini file&nbsp;If you don&#8217;t know where this file is, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,23],"tags":[21,24],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-drupal","category-php","tag-drupal","tag-php"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/57\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}