{"id":501,"date":"2012-12-26T15:19:00","date_gmt":"2012-12-26T15:19:00","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2012\/12\/26\/allowed-memory-size-exausted\/"},"modified":"2025-02-22T10:33:08","modified_gmt":"2025-02-22T15:33:08","slug":"allowed-memory-size-exhausted","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/","title":{"rendered":"How to Fix the Allowed Memory Size Exhausted Error"},"content":{"rendered":"\n<p>A common error with Open Source software like <a href=\"\/support\/edu\/wordpress\/\">WordPress<\/a>, <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/drupal\/\">Drupal<\/a>, <a href=\"\/support\/edu\/moodle\/\">Moodle<\/a>, and <a href=\"\/support\/edu\/joomla\/\">Joomla<\/a> is the PHP <strong>&#8220;Allowed memory size error&#8221;<\/strong>. Increasing the memory limit is an easy solution. This <em>memory_limit<\/em> can be changed in the <em>php.ini<\/em> in the <em>public_html<\/em> folder in your hosting account. This error can creep up in your website during the normal development process. The following is an example of the error:<\/p>\n\n\n\n<p><code>Fatal error: Allowed memory size of 268435465 bytes exhausted<br>(tried to allocate 280559520) in Unknown on line 0<\/code><\/p>\n\n\n\n<p>This is due to PHP variable data being stored in the memory that is not cleared while the PHP scripts for your CMS or web application are running.<\/p>\n\n\n\n<p><strong>For those who code their own sites:<\/strong> Coders use the <strong>unset()<\/strong> function to clear variable data that is no longer needed; however, with open source software, you will not want to alter any code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Fix the &#8220;Allowed Memory Size Exhausted&#8221; Error<\/h2>\n\n\n\n<p>The PHP memory resource can be increased in the <strong>php.ini<\/strong> file located in the <strong>public_html<\/strong> directory on your server. The following steps will explain how to set the php.ini to allow a larger amount of memory use.<\/p>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li><strong><a href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Login to cPanel<\/a><\/strong>.<\/li>\n\n\n\n<li><strong><a href=\"\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\">Go to the File Manager<\/a><\/strong>, or FTP\/SSH into your server.<\/li>\n\n\n\n<li>Select the <strong>Web root (public_html\/www)<\/strong> directory and <strong>click Go<\/strong>.<\/li>\n\n\n\n<li>Find the <strong>php.ini file<\/strong> in the <strong>public_html<\/strong> directory.<br><br><div class=\"alert alert-warning\"><strong>Note!<\/strong> If you do not have a <em>php.ini<\/em> in your <em>public_html<\/em> files, you can <a href=\"\/support\/amp\/how-to-get-great-technical-support\/\">have our tech support staff restore<\/a> the <em>php.ini<\/em> to your <em>public_html<\/em> directory.<\/div><strong>Open the php.ini file<\/strong> with a code editor.<\/li>\n\n\n\n<li>Find the following section in the php.ini file.<br><br><code>max_execution_time = 30<br>max_input_time = 60<br>memory_limit = 128M<\/code><br><br><strong>Increase the <code>memory_limit<\/code> value to 256M<\/strong>. <br><br>If the PHP <code>memory_limit<\/code> is already at 256M, you can increase it to 512M.<br><p class=\"alert alert-warning\"><strong>Important:<\/strong> The PHP <code>max_execution_time<\/code> is capped at <strong>90 seconds<\/strong> on <a href=\"https:\/\/www.inmotionhosting.com\/shared-hosting\">Shared Hosting Plans<\/a> to prevent extremely long processes from impacting other users sharing the server resources. If you need a longer <code>max_execution_time<\/code>, consider one of our <a href=\"https:\/\/www.inmotionhosting.com\/vps-hosting\">VPS Hosting Plans<\/a>.<\/p><\/li>\n\n\n\n<li><strong>Save<\/strong> the changes.<\/li>\n\n\n\n<li>In order for your memory limit to take effect you will need to <strong>make the php.ini recursive<\/strong>.<br><br>\n<div class=\"alert alert-warning\"><strong>Important!<\/strong> Making the php.ini recursive is an important step. If you do not know how to do this, please see our article on <a href=\"\/support\/website\/recursive-php-ini\/\">Make the php.ini recursive in the .htaccess<\/a>.<\/div>\n<\/li>\n<\/ol>\n\n\n\n<p>Now visit the website these changes were applied to. You should not see the &#8220;Allowed memory size&#8221; error anymore. If the error still shows on your website, there may be a setting within the software itself that is overriding the change or the <strong>php.ini<\/strong> file in the <strong>public_html<\/strong> directory may be overwritten by another setting elsewhere. If this is the case, you can contact our <a href=\"\/support\/amp\/how-to-get-great-technical-support\/\">our tech support staff<\/a> to have them look into the error further.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common error with Open Source software like WordPress, Drupal, Moodle, and Joomla is the PHP &#8220;Allowed memory size error&#8221;. Increasing the memory limit is an easy solution. This memory_limit can be changed in the php.ini in the public_html folder in your hosting account. This error can creep up in your website during the normal<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\"> Read More ><\/a><\/p>\n","protected":false},"author":56983,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4335],"tags":[],"class_list":["post-501","post","type-post","status-publish","format-standard","hentry","category-error-numbers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Fix the Allowed Memory Size Exhausted Error<\/title>\n<meta name=\"description\" content=\"This article will explain how to fix the fatal error &quot;Allowed memory size exhausted&quot; by changing a few lines of code in the php.ini file.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fix the Allowed Memory Size Exhausted Error\" \/>\n<meta property=\"og:description\" content=\"This article will explain how to fix the fatal error &quot;Allowed memory size exhausted&quot; by changing a few lines of code in the php.ini file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2012-12-26T15:19:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-22T15:33:08+00:00\" \/>\n<meta name=\"author\" content=\"Carrie Smaha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@carriesmaha\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carrie Smaha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\"},\"author\":{\"name\":\"Carrie Smaha\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\"},\"headline\":\"How to Fix the Allowed Memory Size Exhausted Error\",\"datePublished\":\"2012-12-26T15:19:00+00:00\",\"dateModified\":\"2025-02-22T15:33:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\"},\"wordCount\":428,\"commentCount\":70,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Website Error Numbers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\",\"name\":\"How to Fix the Allowed Memory Size Exhausted Error\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2012-12-26T15:19:00+00:00\",\"dateModified\":\"2025-02-22T15:33:08+00:00\",\"description\":\"This article will explain how to fix the fatal error \\\"Allowed memory size exhausted\\\" by changing a few lines of code in the php.ini file.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix the Allowed Memory Size Exhausted Error\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\",\"name\":\"Carrie Smaha\",\"description\":\"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/carriesmaha\/\",\"https:\/\/x.com\/carriesmaha\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fix the Allowed Memory Size Exhausted Error","description":"This article will explain how to fix the fatal error \"Allowed memory size exhausted\" by changing a few lines of code in the php.ini file.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/","og_locale":"en_US","og_type":"article","og_title":"How to Fix the Allowed Memory Size Exhausted Error","og_description":"This article will explain how to fix the fatal error \"Allowed memory size exhausted\" by changing a few lines of code in the php.ini file.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2012-12-26T15:19:00+00:00","article_modified_time":"2025-02-22T15:33:08+00:00","author":"Carrie Smaha","twitter_card":"summary_large_image","twitter_creator":"@carriesmaha","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Carrie Smaha","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/"},"author":{"name":"Carrie Smaha","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8"},"headline":"How to Fix the Allowed Memory Size Exhausted Error","datePublished":"2012-12-26T15:19:00+00:00","dateModified":"2025-02-22T15:33:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/"},"wordCount":428,"commentCount":70,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Website Error Numbers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/","name":"How to Fix the Allowed Memory Size Exhausted Error","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2012-12-26T15:19:00+00:00","dateModified":"2025-02-22T15:33:08+00:00","description":"This article will explain how to fix the fatal error \"Allowed memory size exhausted\" by changing a few lines of code in the php.ini file.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/allowed-memory-size-exhausted\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Fix the Allowed Memory Size Exhausted Error"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8","name":"Carrie Smaha","description":"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.","sameAs":["https:\/\/www.linkedin.com\/in\/carriesmaha\/","https:\/\/x.com\/carriesmaha"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4335,"name":"Website Error Numbers","slug":"error-numbers","link":"https:\/\/www.inmotionhosting.com\/support\/website\/error-numbers\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/56983"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=501"}],"version-history":[{"count":11,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/501\/revisions"}],"predecessor-version":[{"id":129443,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/501\/revisions\/129443"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}