Arsal • Location • Starter

How to Fix "WordPress Memory Exhausted Error" in cPanel

Client Problem: The website crashes or fails to perform actions, displaying the error "Fatal error: Allowed memory size of X bytes exhausted".

Cause: A WordPress script, plugin, or theme requires more memory than the default allocated PHP memory limit on the server.

Technical Solution Steps:

  1. Log in to cPanel: Access your cPanel account using your credentials.

  2. Increase Memory Limit via File Manager: Open File Manager > public_html, edit the wp-config.php file, and add the line: define('WP_MEMORY_LIMIT', '256M');


  3. Adjust via MultiPHP INI Editor: In cPanel, navigate to Software > MultiPHP INI Editor, select your domain, and update the memory_limit directive to 256M (or 512M).


  4. Update via .htaccess: If using Apache, open .htaccess in public_html and append: php_value memory_limit 256M


  5. Save and Test: Save all changes and reload the website to confirm the memory limit error is resolved.