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.
- Ad clickVisitor lands on a light page
- Product or form pageLoads normally
- Checkout or submitPHP hits memory_limit, blank page or 500
- Thank-you pageNever reached
- 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
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.
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.
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.
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.
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 212How to fix it
Raising the limit is the quick fix. Finding what is eating memory is the real fix. Do both, in that order.
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');.
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.
php.ini
Set memory_limit = 256M in php.ini or in the PHP settings page of your host panel (often called MultiPHP INI Editor or PHP Options), then save.
.user.ini or .htaccess
On many shared hosts, add memory_limit = 256M to .user.ini in the site root. On Apache with mod_php you can use php_value memory_limit 256M in .htaccess. A wrong directive can cause a 500, so keep a backup.
PHP-FPM pool
On your own server, set php_admin_value[memory_limit] = 256M in the pool file, then reload PHP-FPM.
Nothing to raise
Shopify runs the server for you, so there is no memory_limit to change. If a custom app or a self-hosted middle layer you own shows this error, fix it on that server.
Nothing to raise
Wix hosting is managed, so PHP memory is not yours to set. Look at any external PHP endpoint you call from forms or Velo code.
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );Read the file path in the log
The path in the error line usually names the plugin or theme that ran out of memory.
Test by disabling
On a staging copy, deactivate that plugin or switch to a default theme and repeat the failing action.
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.
Reduce heavy work
Move big imports, exports, backups and image processing off peak hours, and split large jobs into batches.
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
- 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
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
- 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.
Related issues
- OPS-084Error display on (PHP warnings shown to visitors)Fix guide
- OPS-085Debug mode on in production (stack traces)Fix guide
- OPS-077PHP version end of lifeFix guide
- OPS-078PHP upgrade breaking plugins/formsFix guide
- OPS-074CPU throttling / entry process limits on shared hostingFix guide
- OPS-075Database connection errors ('Error establishing a database connection')Fix guide