Increase WordPress PHP Memory Limit Exhaustion Print

  • 12

WordPress is an application that runs on a computer, in this case, the computer is a web server, or in the case of KartHost WordPress servers Cloud Servers.

By default according to WordPress Codex WordPress will attempt to increase the memory up to 40 MB of PHP Memory for single WordPress installs and if you are using a multisite WordPress will attempt to allocate up to 64 MB of memory.

Of course, this depends on your hosting service and what they allow as the maximum memory. All KartHost Managed WordPress sites (including the EZWP Package) are set to 1024 MB of memory, and our Self Managed WordPress is 256 MB of PHP Memory by default.
So if you do run into any issues we recommend you make the following change to your wp-config.php* file by adding the line to increase your memory.

To do this you will need to locate your wp-config.php* file and open it in an editor after opening scroll down to where you see 

/* That's all, stop editing! Happy blogging. */

Right above that add this line of code:

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

or

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

A suggestion is to add a commented-out state to explain what you did and when and maybe why, not required but makes for nice notes. As an example, you might add:

/** increased memory limit 01-21-2024 */
define('WP_MEMORY_LIMIT','256M');

Then make sure you save your handy work and then go back and refresh your page (clearing your web browser cache might be in order) and try the last function you attempted before you received your error.

If you are a KartHost Customer hosting client, especially if you are a Managed WordPress client, open a WordPress Help Desk Ticket and we will be happy to assist you in doing this or if you wish, take care of it for you.

 

Note: *If you are using the KartHost Convesio Container hosting, do not change the wp-config.php file but the wp-convesio.php file. The nature of the Convesio Container we use can overwrite the wp-config.php file and you would lose your custom addition.

updated January 21, 2024


Was this answer helpful?

« Back