Memory Exhausted Error

Memory Exhausted Error

Posted by

“Memory Exhausted Error” is a common problem in WordPress that occurs when PHP is using more memory than the allotted memory limit. Its error message is something like this:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate...) in /home/your-site/wp-includes/...

Memory Exhausted Error – Full Solution Guide


Step 1: Increase PHP Memory Limit in wp-config.php

  1. Go to your website’s root folder (public_html)
  2. Open wp-config.php
  3. Add this line before /* That's all, stop editing! */
define( 'WP_MEMORY_LIMIT', '256M' );

Try values like 128M, 256M, or even 512M Depending on hosting limits.


Step 2: Update .htaccess (If step 1 doesn’t work)

  1. Open .htaccess file in your root directory
  2. Add this line at the top or bottom:
php_value memory_limit 256M

Some shared hostings may not allow this. If error shows after this step, remove the line.


Memory Exhausted Error
Memory Exhausted Error

Step 3: Create/Update php.ini (if allowed by hosting)

  1. If your server allows custom php.iniCreate it in the root.
  2. Add this line:
memory_limit = 256M

For some hostings, place it inside /wp-admin/ folder too.


Step 4: Contact Hosting Support

If none of the above steps work:

  • Ask your hosting support to increase the PHP memory limit for you.
  • Recommended: 256M minimum.

Recommended Memory Limits

Task TypeRecommended PHP Memory
Basic site128M
WooCommerce site256M or more
Elementor/Heavy themes256–512M

Pro Tips

  • Keep plugins/themes updated.
  • Avoid bloated page builders if hosting is weak.
  • Use a lightweight theme and caching plugin like LiteSpeed Cache.

Would you like a screenshot image (1280×720) or a PDF guide for this solution?

PJSU2 Pyhton Library RTP packet capturing