Skip to content
FunnelGuard

Fix guide by FunnelsGuard

PHP memory limit exhausted (white screen): how to find and fix it

OPS-073High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

PHP gives each request a memory budget, set by the memory_limit setting. If a page needs more than that budget, PHP stops with a fatal error: Allowed memory size of 134217728 bytes exhausted. Nothing is sent to the browser after that point, so you see a white screen or a generic 500 error.

Why it costs you leads or sales

The pages that use the most memory are often the ones that make money: checkout, cart, account, search and form submissions. When they die silently, the visitor sees an empty page and leaves. Your ad spend still gets the click, but no lead or order follows. Because the rest of the site looks normal, nobody on your team may notice for days.

Where a memory error breaks the funnel
  1. Ad clickVisitor lands on a light page
  2. Product or form pageLoads normally
  3. Checkout or submitPHP hits memory_limit, blank page or 500
  4. Thank-you pageNever reached
  5. Conversion tag and CRM leadNever sent

The landing page loads, but the step that needs more memory fails and everything after it is lost.

How to check if your site has it

Confirm a memory exhaustion error
  1. Open the PHP error log

    In your host's control panel look for Logs, Error log or PHP error log. On WordPress also check wp-content/debug.log if debugging to a file is on.

  2. Search for the message

    Search for 'Allowed memory size' or 'Out of memory'. The line names the file and line number that was running, which usually points to a plugin or theme folder.

  3. Note the page and time

    Match the log time with the page that failed. Repeat the action (submit the form, open checkout) and see if a new line appears.

  4. Check the current limitWordPress

    In WordPress go to Tools > Site Health > Info > Server and read 'PHP memory limit'. Elsewhere, run phpinfo() or ask your host.

Typical log linetext
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /wp-content/plugins/example-plugin/includes/report.php on line 212

How to fix it

Raising the limit is the quick fix. Finding what is eating memory is the real fix. Do both, in that order.

Raise the memory limit
  1. Set WP_MEMORY_LIMIT

    Edit wp-config.php and add define('WP_MEMORY_LIMIT', '256M'); above the line 'That's all, stop editing'. For admin screens you can also add define('WP_MAX_MEMORY_LIMIT', '512M');.

  2. Check the server cap

    WordPress cannot go above the server's own memory_limit. If Site Health still shows the old value, raise it with the methods under Custom code or ask your host.

wp-config.phpphp
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
Then find the cause
  1. Read the file path in the log

    The path in the error line usually names the plugin or theme that ran out of memory.

  2. Test by disabling

    On a staging copy, deactivate that plugin or switch to a default theme and repeat the failing action.

  3. Update or replace

    Update the plugin, theme and PHP-compatible extensions. If memory use stays high, replace it or ask the developer about a fix.

  4. Reduce heavy work

    Move big imports, exports, backups and image processing off peak hours, and split large jobs into batches.

  5. Upgrade hosting if needed

    If a healthy site still needs more memory than your plan allows, move to a plan with more RAM.

How to confirm it's fixed

Fix verification
  • Site Health or phpinfo shows the new memory_limit value
  • The page that failed now loads and the action completes
  • No new 'Allowed memory size' lines appear in the error log after repeating the action
  • A test form submission reaches your inbox or CRM
  • A test checkout reaches the thank-you page (use the store's test mode)
  • The conversion tag fires on the thank-you page
Before and after

Memory exhausted

  • Checkout shows a white screen
  • Log shows Allowed memory size exhausted
  • No orders or leads from paid clicks

Limit raised and cause fixed

  • Checkout completes and shows the thank-you page
  • Error log stays clean
  • Conversions and leads are recorded

How to prevent it happening again

Prevention habits
  • Test plugin and theme updates on staging before live
  • Remove plugins you do not use
  • Keep PHP on a supported version
  • Check the error log after each release
  • Schedule backups and imports for quiet hours
  • Watch your hosting plan's resource usage
  • Monitor key journeys so a blank page is caught within minutes

How FunnelGuard handles this

FunnelGuard detects this problem from the outside. A robot visitor runs your real journeys, such as a lead form or checkout, on a schedule from the EU or the US. When a step returns a blank page or a 500 error, the check fails. FunnelGuard re-checks from a second region, then sends one alert (email, Slack, Teams, WhatsApp, webhook or PagerDuty) with a screenshot and a likely cause.

Common questions

Questions people ask

Why is my WordPress site showing a white screen?

A common cause is a PHP fatal error, and memory exhaustion is one of the most frequent. Check the PHP error log for 'Allowed memory size exhausted'. If it is there, raise memory_limit and find the plugin or theme using too much.

How do I increase the PHP memory limit?

Set memory_limit = 256M in php.ini, .user.ini or your host's PHP settings page. On WordPress you can also add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php, but it cannot exceed the server's own limit.

What is a good PHP memory_limit for WordPress?

256M suits most marketing sites and WooCommerce stores. Large page builders, imports or heavy plugins may need 512M. If you need much more, find out what is using it rather than raising the cap.

Why does the error only happen on checkout or form submit?

Those steps run more code, such as payment, shipping, email and CRM plugins, so they need more memory than a simple page. The limit is per request, so only the heavy request fails.

Can a memory error stop leads without me noticing?

Yes. The site can look fine while the form submit or checkout page fails for visitors. Automated journey checks catch this, because they run the real steps on a schedule.

Should I set memory_limit to -1?

No. It removes the cap, so one faulty script can use all server memory and bring down the site and others on the server. Use a fixed value like 256M or 512M.

I raised the limit and the error is still there. Why?

The new value may not be applied, because the host caps it or another config file overrides it. Check the live value in Site Health or phpinfo. If it is correct, a plugin may be in a loop, which more memory will not fix.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: Blank page or 500.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.