Website Without PHP
English (United Kingdom)GB
  • English (United States)
  • English (United Kingdom)
  • Dutch (Netherlands)
  • Dutch (Belgium)
Menu

Allowed Memory Size Exhausted in PHP: How to Fix It

Your site ran out of the working memory your hostingWeb hosting is the service that keeps your website's files on a computer that is always online, so visitors can open your site at any time. gives it, so a page stopped halfway.

Which PHP version does your site report?

We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

Get help with your website

More about this

Visitors may see an error or a blank page, and uploads, imports or a checkout can fail at the moment a customer needs them.

Often the fix is small, and the steps below show you where to start.

Error

The error "Allowed memory size of X bytes exhausted" means that a PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. script tried to use more memory than the memory_limitmemory_limit is a PHP setting that decides how much memory the code behind one page may use. If it needs more, it stops with an error. setting allows, so PHP stopped it. It is a fatal error, and it often appears while a site imports data, resizes images, runs a heavy pluginA WordPress plugin is an add-on you install in WordPress to give your site extra features, such as contact forms, SEO tools or a webshop. or loads a large page.

What the message means

Every PHP request gets a memory budget. The memory_limit setting defines that budget, and your host or your configuration sets it. The message shows the limit in bytes and then how many more bytes the script tried to claim.

When the script goes over the limit, PHP ends it on the spot, and the visitor sees a blank page, an error or a half-loaded page.

Common causes

The limit is often set low by the host, which is a common reason on shared hostingShared hosting is a hosting plan where many websites share one computer. It is cheap and simple, but your host decides which PHP versions you can use.. A plugin or themeA WordPress theme is a ready-made package that decides how your WordPress site looks and how its pages are laid out. Change the theme and the design changes. that loads too much data at once is another. Large image uploads, big imports, backupA backup is a separate copy of your website's files and database, so you can bring the site back after a mistake, a hack or a failed update. tools and page builders are typical heavy users.

Sometimes the real culprit is a loop in the code that never ends and keeps filling memory, in which case raising the limit only delays the error.

How to check it safely

Start with a backup. Then read the error logAn error log is a file where your website's software writes down what went wrong, with the time and place. It is the first thing to check when a site breaks. to see which file and line hit the limit, because that points at the plugin or script that uses the memory. Look up the current memory_limit in your hosting panel, in a PHP info page from your host, or in the WordPress Site HealthWordPress Site Health displays diagnostic checks and technical information about your WordPress website. screen if you can still log in.

Do not leave a PHP info page lying around on a public site, since it shows server details. Note what the site was doing when the error appeared, such as an upload or an import.

What you can try yourself

Try these steps in order.

First, repeat the action that failed, with one change at a time, so you can see what triggers it. Second, deactivate the plugin the log points at and test again. Third, raise the limit moderately, either in your hosting panel or in the PHP configuration, or ask your host to do it.

On WordPressWordPress is free software for building and editing a website in your browser. It is written in PHP, so it builds each page when someone visits. the memory constant in the configuration file can also be raised, although the host limit still applies. Raise in small steps, because a very high limit can hide a real fault and use up server resources. Fourth, if the error returns even with more memory, the code probably has a fault and needs repair.

Keep passwords private when you contact anyone for help.

When the PHP versionA PHP version is a numbered edition of PHP, like 8.3. Each edition is looked after for a limited time, then gets security fixes only, then nothing. is the cause

A PHP update can change memory use, and some hosts apply separate settings to each PHP version. After a version change, check that the limit is still what you expect. Older plugins may also behave worse on newer versions.

The supported versions page on this site explains which versions the PHP project still maintains.

When to get help

If the limit is capped by your host, if raising it does not help, or if the problem hits during a busy period, ask for help. At Website Without PHP a human replies within 1 working day. A rush repair starts from £315, excluding VAT.

Frequently asked questions

Is the file named in the message the cause?

Not always. It is the place where the script hit the limit. If the same plugin or file shows up every time, it is the likely cause.

If the file changes each time, the site as a whole may simply need more memory than the limit allows.

Why does raising the limit in WordPress not help?

The WordPress setting cannot go above the limit that your server or host allows. If the host caps memory, raise it in your hosting panel or ask your host to do it.

What is a sensible memory limit?

There is no single right number, because it depends on what the site does. Raise the limit in small steps and stop when the error is gone. If the error keeps coming back, the code probably has a fault.

Can I set the memory limit to unlimited?

Better not. Without a limit, a fault in the code is hidden and one request can claim memory the rest of the server needs. A limit that fits the site keeps faults visible.

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

We keep the domain and the result, never your IP address.