{"id":542,"date":"2023-02-27T17:15:00","date_gmt":"2023-02-27T17:15:00","guid":{"rendered":"https:\/\/hannahrosebergman.com\/?p=542"},"modified":"2023-02-27T21:16:17","modified_gmt":"2023-02-27T21:16:17","slug":"how-to-increase-php-memory-limit-through-hostgator-other-hosting-platforms","status":"publish","type":"post","link":"https:\/\/hannahrosebergman.com\/index.php\/2023\/02\/27\/how-to-increase-php-memory-limit-through-hostgator-other-hosting-platforms\/","title":{"rendered":"How To Increase PHP Memory Limit Through HostGator &#038; other Hosting Platforms"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">The Problem<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;re building a WordPress website and get a &#8220;memory limit&#8221; error. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I find this is one of the most common errors I get when I first start building a new WordPress site through HostGator and other hosting platforms. It typically pops up after I install a plugin immediately after installing WordPress on a new domain without first manually adjusting the memory limit. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The error itself occurs because PHP is trying to process a large database record (eg, your new WordPress site) or when importing\/exporting information into\/from the database (eg, you creating all the new files of your WP site). <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a step-by-step walkthrough of the resolution of this problem with screenshots dating from late 2022 via HostGator. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your dashboard GUI may look slightly different than this but the steps should still be relatively similar if not the same. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1. Login to cPanel &amp; go to File Manager<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"664\" src=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog1-1024x664.png\" alt=\"\" class=\"wp-image-544\" srcset=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog1-1024x664.png 1024w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog1-300x194.png 300w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog1-768x498.png 768w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog1-1536x996.png 1536w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog1.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2. Find the &#8216;public_html&#8217; folder within your File Manager<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"664\" src=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog2-1024x664.png\" alt=\"\" class=\"wp-image-545\" srcset=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog2-1024x664.png 1024w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog2-300x194.png 300w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog2-768x498.png 768w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog2-1536x996.png 1536w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog2.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3. Find the &#8216;wp-config.php&#8217; file within the &#8216;public_html&#8217; folder <\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"664\" src=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog3-1024x664.png\" alt=\"\" class=\"wp-image-546\" srcset=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog3-1024x664.png 1024w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog3-300x194.png 300w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog3-768x498.png 768w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog3-1536x996.png 1536w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog3.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4. Right click on the &#8216;wp-config.php&#8217; file and select &#8216;Edit&#8217;<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"664\" src=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog4-1024x664.png\" alt=\"\" class=\"wp-image-547\" srcset=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog4-1024x664.png 1024w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog4-300x194.png 300w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog4-768x498.png 768w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog4-1536x996.png 1536w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog4.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A pop-up might appear with a warning asking you to confirm that you want to edit this file. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Just go ahead and click &#8220;Edit&#8221; to confirm. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"664\" src=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog5-1024x664.png\" alt=\"\" class=\"wp-image-548\" srcset=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog5-1024x664.png 1024w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog5-300x194.png 300w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog5-768x498.png 768w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog5-1536x996.png 1536w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog5.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 5.  Increase the PHP memory with this code snippet<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Find the commented out line within the wp-config.php file that says something along the lines of:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* That\u2019s all, stop editing! Happy publishing. *\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Above that line, enter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_MEMORY_LIMIT', '128M' );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will define and increase your memory limit to 128M. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If this doesn&#8217;t work immediately you can try changing it from 128M to 256M, but really anything higher than that isn&#8217;t necessary. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"664\" src=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog6-1024x664.png\" alt=\"\" class=\"wp-image-549\" srcset=\"https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog6-1024x664.png 1024w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog6-300x194.png 300w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog6-768x498.png 768w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog6-1536x996.png 1536w, https:\/\/hannahrosebergman.com\/wp-content\/uploads\/2023\/02\/hbblog6.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Note: Some hosts enforce extremely low memory limits to keep account costs down so you may not be able to raise it yourself! <\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>If you run into this problem, you might need to upgrade your current hosting plan, switch to a better hosting provider that allows you to manually increase the memory limit yourself at a lower cost, or delete the plugin(s) that caused this issue and find a workaround. <\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Problem You&#8217;re building a WordPress website and get a &#8220;memory limit&#8221; error. I find this is one of the most common errors I get when I first start building a new WordPress site through HostGator and other hosting platforms. It typically pops up after I install a plugin immediately after installing WordPress on a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[13],"tags":[],"class_list":["post-542","post","type-post","status-publish","format-standard","hentry","category-how-to-guides"],"_links":{"self":[{"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/posts\/542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/comments?post=542"}],"version-history":[{"count":9,"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/posts\/542\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/posts\/542\/revisions\/557"}],"wp:attachment":[{"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/media?parent=542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/categories?post=542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hannahrosebergman.com\/index.php\/wp-json\/wp\/v2\/tags?post=542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}