{"id":13792,"date":"2019-08-21T09:37:54","date_gmt":"2019-08-21T09:37:54","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?post_type=ht_kb&#038;p=13792"},"modified":"2019-08-21T10:03:37","modified_gmt":"2019-08-21T10:03:37","slug":"how-to-solve-fatal-error-allowed-memory-size-issue","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/how-to-solve-fatal-error-allowed-memory-size-issue\/","title":{"rendered":"How to solve &#8220;Fatal error: Allowed memory size&#8221; issue?"},"content":{"rendered":"\n<p>Your WordPress website needs computer memory to function. Sometimes, the memory allocated may not be enough to run your site <\/p>\n\n\n\n<p> When your WordPress code requires more memory than the default allocated memory, you get to see this error \u201c<strong>Fatal error: Allowed memory size<\/strong>\u201d  like below the screenshot. <br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"550\" height=\"218\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/5-3.png\" alt=\"\" class=\"wp-image-13793\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/5-3.png 550w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/5-3-300x119.png 300w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/5-3-50x20.png 50w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/5-3-60x24.png 60w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/5-3-100x40.png 100w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/figure>\n\n\n\n<p>By default,  WordPress first tries to increase your memory limit to 64mb. Seeing this error indicates this size is still not enough, or in some cases, your server prevents the allocation of more memory. <\/p>\n\n\n\n<h4>Increase PHP Memory Limit in WordPress<br><\/h4>\n\n\n\n<p>You can manually increase the memory limit in WordPress by editing the wp-config file. <\/p>\n\n\n\n<p><strong>Step 1<\/strong> &#8211; First, you need to edit the <a href=\"https:\/\/www.wpbeginner.com\/beginners-guide\/how-to-edit-wp-config-php-file-in-wordpress\/\">wp-config.php file<\/a>&nbsp;on your WordPress site. It is located in your WordPress site\u2019s root folder, and you will need to use an&nbsp;<a href=\"https:\/\/www.wpbeginner.com\/showcase\/6-best-ftp-clients-for-wordpress-users\/\">FTP client<\/a>&nbsp;or file manager in your web hosting control panel.<br><\/p>\n\n\n\n<p><strong>Step 2<\/strong> &#8211; When connected, your site folders and files will be displayed in the bottom right of your screen. Look for the folder containing all your WordPress files and double-click to open it.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/cdn.fixrunner.com\/wp-content\/uploads\/2018\/07\/Main-WordPress-folder-fix-allowed-memory-size-exhausted-in-WordPress.png\"><img decoding=\"async\" src=\"https:\/\/cdn.fixrunner.com\/wp-content\/uploads\/2018\/07\/Main-WordPress-folder-fix-allowed-memory-size-exhausted-in-WordPress.png\" alt=\"Main WordPress folder - fix allowed memory size exhausted in WordPress\" class=\"wp-image-7811\"\/><\/a><\/figure><\/div>\n\n\n\n<p><strong>Step 3<\/strong> &#8211; In this folder, locate your wp-config file, right-click on it, and click <strong>View\/Edit.<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/cdn.fixrunner.com\/wp-content\/uploads\/2018\/07\/Edit-wp-config-fix-allowed-memory-size-exhausted-in-WordPress.png\"><img decoding=\"async\" src=\"https:\/\/cdn.fixrunner.com\/wp-content\/uploads\/2018\/07\/Edit-wp-config-fix-allowed-memory-size-exhausted-in-WordPress.png\" alt=\"Edit wp-config - fix allowed memory size exhausted in WordPress\" class=\"wp-image-7812\"\/><\/a><\/figure><\/div>\n\n\n\n<p><strong>Step 4<\/strong> &#8211; When the file opens in your text editor, scroll towards the bottom to find the line you need to paste this code in the &#8220;<strong>wp-config.php<\/strong>&#8221; file just before the line that says \u2018That\u2019s all, stop editing! Happy blogging.\u2019 <\/p>\n\n\n\n<p>define( &#8216;WP_MEMORY_LIMIT&#8217;, &#8216;256M&#8217; );<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"785\" height=\"338\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/6-3.png\" alt=\"\" class=\"wp-image-13808\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/6-3.png 785w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/6-3-300x129.png 300w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/6-3-768x331.png 768w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/6-3-50x22.png 50w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/6-3-60x26.png 60w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/08\/6-3-100x43.png 100w\" sizes=\"(max-width: 785px) 100vw, 785px\" \/><\/figure>\n\n\n\n<p>This code tells WordPress to increase the PHP memory limit to 256MB.<\/p>\n\n\n\n<p><strong>Step 5 <\/strong>&#8211; Once you are done, you need to save your changes and upload your wp-config.php file back to your server.<\/p>\n\n\n\n<p><strong>Step 6<\/strong> &#8211; Now reload your site. The problem should be fixed and your site should display properly.<\/p>\n\n\n\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n\n\n\n<p>We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><br><br> <\/p>\n<div id=\"div-1\" class=\"hkb-feedback\">\n\t\t\t<strong class=\"ht-mobile-exit__title\">Ask your Questions Directly!<\/strong><br>\n\t\t\t<div class=\"hkb_widget_exit__content\" style=\"font-size: 14px;\">If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!<\/div>\n\t\t\t<a href=\"https:\/\/ampforwp.com\/support\/#contact\" id=\"button\" target=\"_blank\" rel=\"noopener noreferrer\"><button>Yes, I have a Question<\/button><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Your WordPress website needs computer memory to function. Sometimes, the memory allocated may not be enough to run your site When your WordPress code requires more memory than the default allocated memory, you get to see this error \u201cFatal error: Allowed memory size\u201d like below the screenshot. By default, WordPress&#8230;<\/p>\n","protected":false},"author":18,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[6,5],"ht-kb-tag":[],"_links":{"self":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/13792"}],"collection":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/comments?post=13792"}],"version-history":[{"count":18,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/13792\/revisions"}],"predecessor-version":[{"id":13812,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/13792\/revisions\/13812"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=13792"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=13792"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=13792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}