{"id":1335,"date":"2020-02-18T11:20:00","date_gmt":"2020-02-18T10:20:00","guid":{"rendered":"https:\/\/www.wp-moon.com\/?p=1335"},"modified":"2020-02-18T11:43:18","modified_gmt":"2020-02-18T10:43:18","slug":"resolve-the-error-fatal-error-allowed-memory-size-exhausted","status":"publish","type":"post","link":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/","title":{"rendered":"Resolve the error : Fatal error: Allowed memory size exhausted"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_custom_heading text=&#8221;Issue&#8221; use_theme_fonts=&#8221;yes&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]When accessing your site, or for any operation, the following error may appear :[\/vc_column_text][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<code>Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 262144 bytes)<\/code>[\/vc_column_text][\/vc_column][\/vc_row][vc_row][vc_column][vc_custom_heading text=&#8221;Where does this error come from?&#8221; use_theme_fonts=&#8221;yes&#8221;][vc_column_text]The PHP memory error comes from the fact that you don&#8217;t have enough memory to perform the action you want.<\/p>\n<p>This can happen when you have a very greedy script for example. PHP has a limited amount of memory. When this limit is reached, you encounter the error mentioned in this article.<\/p>\n<p>PHP is a powerful server language, allowing you to manage multiple tasks. Depending on whether you use WordPress, Woocommerce, or you add plugins or scripts, your site will require more or less memory.<\/p>\n<p>When WordPress reaches the memory limit for PHP, it tries to allocate a little more. But when this is no longer possible, the fatal error of this article is displayed.[\/vc_column_text][\/vc_column][vc_column][vc_custom_heading text=&#8221;What can be done to solve this problem?&#8221; use_theme_fonts=&#8221;yes&#8221;][vc_column_text]Depending on the origin of the problem, there are several possible solutions:<\/p>\n<ul>\n<li>Increase the limit of memory usable for WordPress: it is necessary for that to open the file wp-config.php and define the maximum desired:<br \/>\n<code>define( 'WP_MEMORY_LIMIT', '96M' )<\/code> (example)<\/li>\n<li><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Check with your hosting provider to see if they can give you more memory or make the necessary adjustment.<\/span><\/span><\/li>\n<li>Test your connection with mysqli :<br \/>\n<code>$mysqli_connection = new MySQLi('host', 'user', 'password', 'database_name');<\/code><\/li>\n<li><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Edit the php.ini file to increase the memory for all applications:<\/span><\/span><br \/>\n<code>memory_limit = 256M<\/code><\/li>\n<li>(<span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">not recommended) Increase memory via the .htaccess file:<\/span><\/span><br \/>\n<code>php_value memory_limit 256M<\/code><\/li>\n<\/ul>\n<p>For the amount of memory to be defined, you must be able to estimate your needs. A Woocommerce site will generally consume more memory than a simple WordPress site. Then, depending on the plugins used, the amount of memory required may increase.<\/p>\n<p>Finally, if you find that the amount of memory required for the proper functioning of your site is too large, ask yourself if you would not have a script or a plugin too greedy. Because in addition to causing you this type of problem, your WordPress site can be slowed down or cause other problems.<\/p>\n<p>Finally, do not forget to keep your site up to date, both on the technologies used and on WordPress and its plugins.[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>The PHP memory error comes from the fact that you don&#8217;t have enough memory to perform the action you want.<br \/>\nThis can happen when you have a very greedy script for example. PHP has a limited amount of memory. When this limit is reached, you encounter the error mentioned in this article.<\/p>\n","protected":false},"author":2,"featured_media":1338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[54],"class_list":["post-1335","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fix-errors","tag-memory-size"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Resolve the error : Fatal error: Allowed memory size exhausted - WP Moon<\/title>\n<meta name=\"description\" content=\"The PHP memory error comes from the fact that you don&#039;t have enough memory to perform the action you want. This can happen when you have a very greedy script for example. PHP has a limited amount of memory. When this limit is reached, you encounter the error mentioned in this article.\" \/>\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.wp-moon.com\/en\/resolve-the-error-fatal-error-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=\"Resolve the error : Fatal error: Allowed memory size exhausted - WP Moon\" \/>\n<meta property=\"og:description\" content=\"The PHP memory error comes from the fact that you don&#039;t have enough memory to perform the action you want. This can happen when you have a very greedy script for example. PHP has a limited amount of memory. When this limit is reached, you encounter the error mentioned in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Moon\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpmoonwebsite\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-18T10:20:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-02-18T10:43:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/MEMORY.png\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"253\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alexandre G\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@alexgaboriau\" \/>\n<meta name=\"twitter:site\" content=\"@WPMoon4\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexandre G\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Resolve the error : Fatal error: Allowed memory size exhausted - WP Moon","description":"The PHP memory error comes from the fact that you don't have enough memory to perform the action you want. This can happen when you have a very greedy script for example. PHP has a limited amount of memory. When this limit is reached, you encounter the error mentioned in this article.","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.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/","og_locale":"en_US","og_type":"article","og_title":"Resolve the error : Fatal error: Allowed memory size exhausted - WP Moon","og_description":"The PHP memory error comes from the fact that you don't have enough memory to perform the action you want. This can happen when you have a very greedy script for example. PHP has a limited amount of memory. When this limit is reached, you encounter the error mentioned in this article.","og_url":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/","og_site_name":"WP Moon","article_publisher":"https:\/\/www.facebook.com\/wpmoonwebsite","article_published_time":"2020-02-18T10:20:00+00:00","article_modified_time":"2020-02-18T10:43:18+00:00","og_image":[{"width":512,"height":253,"url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/MEMORY.png","type":"image\/png"}],"author":"Alexandre G","twitter_card":"summary_large_image","twitter_creator":"@alexgaboriau","twitter_site":"@WPMoon4","twitter_misc":{"Written by":"Alexandre G","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#article","isPartOf":{"@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/"},"author":{"name":"Alexandre G","@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/person\/72a64e6910977ec9e4b32fd8da54369d"},"headline":"Resolve the error : Fatal error: Allowed memory size exhausted","datePublished":"2020-02-18T10:20:00+00:00","dateModified":"2020-02-18T10:43:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/"},"wordCount":437,"commentCount":0,"publisher":{"@id":"https:\/\/www.wp-moon.com\/en\/#organization"},"image":{"@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/MEMORY.png","keywords":["memory size"],"articleSection":["Fix Errors"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/","url":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/","name":"Resolve the error : Fatal error: Allowed memory size exhausted - WP Moon","isPartOf":{"@id":"https:\/\/www.wp-moon.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#primaryimage"},"image":{"@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/MEMORY.png","datePublished":"2020-02-18T10:20:00+00:00","dateModified":"2020-02-18T10:43:18+00:00","description":"The PHP memory error comes from the fact that you don't have enough memory to perform the action you want. This can happen when you have a very greedy script for example. PHP has a limited amount of memory. When this limit is reached, you encounter the error mentioned in this article.","breadcrumb":{"@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#primaryimage","url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/MEMORY.png","contentUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/MEMORY.png","width":512,"height":253},{"@type":"BreadcrumbList","@id":"https:\/\/www.wp-moon.com\/en\/resolve-the-error-fatal-error-allowed-memory-size-exhausted\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.wp-moon.com\/en\/"},{"@type":"ListItem","position":2,"name":"Fix Errors","item":"https:\/\/www.wp-moon.com\/en\/category\/fix-errors\/"},{"@type":"ListItem","position":3,"name":"Resolve the error : Fatal error: Allowed memory size exhausted"}]},{"@type":"WebSite","@id":"https:\/\/www.wp-moon.com\/en\/#website","url":"https:\/\/www.wp-moon.com\/en\/","name":"WP Moon","description":"","publisher":{"@id":"https:\/\/www.wp-moon.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wp-moon.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.wp-moon.com\/en\/#organization","name":"WP Moon","url":"https:\/\/www.wp-moon.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/logo.png","contentUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2020\/02\/logo.png","width":290,"height":95,"caption":"WP Moon"},"image":{"@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/wpmoonwebsite","https:\/\/x.com\/WPMoon4"]},{"@type":"Person","@id":"https:\/\/www.wp-moon.com\/en\/#\/schema\/person\/72a64e6910977ec9e4b32fd8da54369d","name":"Alexandre G","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2023\/09\/312419460_10229483707296045_2919774527885824513_n-100x100.jpg","url":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2023\/09\/312419460_10229483707296045_2919774527885824513_n-100x100.jpg","contentUrl":"https:\/\/www.wp-moon.com\/wp-content\/uploads\/2023\/09\/312419460_10229483707296045_2919774527885824513_n-100x100.jpg","caption":"Alexandre G"},"description":"Alexandre, Web Developer &amp; Website Editor. I've been using WordPress for over 10 years in my professional environment and on personal projects. I created WP Moon to teach you how to use this CMS, solve your problems and show you all the tricks.","sameAs":["https:\/\/www.croque-pixel.com\/","https:\/\/x.com\/alexgaboriau","https:\/\/www.youtube.com\/@wp_moon\/videos"],"url":"https:\/\/www.wp-moon.com\/en\/author\/wp-moon\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/posts\/1335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/comments?post=1335"}],"version-history":[{"count":0,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/posts\/1335\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/media\/1338"}],"wp:attachment":[{"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/media?parent=1335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/categories?post=1335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wp-moon.com\/en\/wp-json\/wp\/v2\/tags?post=1335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}