Fix: WordPress Memory Exhausted Error – Increase PHP Memory

Avatar
C

Callum Davies

Senior Backend Engineer••
8058Views
5mRead
0Reactions

In this article, I will how to fix WordPress memory limit issues when they are not allowed to allocate memory of more than 128M. PHP servers by default set a memory limit of 128M.

Look at the errors:

Fatal error: The allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx

 

Increase PHP Memory Limit in WordPress

You need to update wp-config.php to override the default WordPress memory limit.

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

This code tells WordPress to increase the PHP memory limit to 256MB.

If the problem is not fixed yet, you need to contact your hosting/server provider to increase the memory limit.

 

You can easily fix your problem. Happy blogging ❤️.

Connect with KoderSolution 🚀

Master modern software engineering, scalable architectures, and advanced backend systems.

What's your setup?What's your production setup for this scenario? Have you encountered similar architectural bottlenecks or edge-case gotchas?
Callum Davies
C
Written by•Senior Backend Engineer

Callum Davies

PHP & Laravel practitioner since v5.4. Big believer in thin controllers, explicit return types, and boring modular architecture that doesn't page you on weekends.

React to this article

Recommended Articles

View all articles