Knowledgebase

Fatal error: Allowed memory size exhausted Print

  • errors, plugins, wordpress, php, troubleshooting, cpanel, backup, guide
  • 0

The script used more memory than permitted.

WHAT IT MEANS

PHP reached its memory limit and stopped.

THE IMMEDIATE FIX

cPanel > MultiPHP INI Editor. Raise memory_limit to 256M.

For WordPress, also add to wp-config.php:

define('WP_MEMORY_LIMIT', '256M');

WHAT USUALLY CAUSES IT

A heavy plugin Image processing, which is memory-intensive A large import or export A query loading an enormous result set Too many plugins together

THE REAL FIX

Raising the limit treats the symptom. If an ordinary page load needs 512M, something is wrong.

Find what consumes it: a profiling tool shows memory use per plugin.

IF IT HAPPENS DURING A SPECIFIC OPERATION

An import, a backup, a bulk update. Raise the limit temporarily for that operation, then investigate why it needs so much.

IF IT HAPPENS ON ORDINARY PAGES

Something is genuinely wrong. Disable plugins to find which, or profile the site.

THE ERROR NAMES A FILE

That file is where memory ran out, not necessarily what consumed it. The cause is usually earlier.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot