When you have a WordPress website installed, it is common to have errors once in a while when your website is down or in need of debugging or troubleshooting. One of the most common WordPress error is the “Memory exhausted error”
Why do you get the “Memory exhausted error”?
You get these error on your website as either a website screen of death or with an error like the one below:
Fatal error: Uncaught Error: Class ‘Mfn_Dashboard’ not found in
The above error occurs when a WordPress plugin or script exhausts the default allocated memory size limit. You would get the above error with the cause of the issue if you have “WP_Debug” set to true, if not you would get the white screen of death (white blank screen).
You get this error because WordPress is written in PHP, a server-side programming language. The error shows hope when there is a misconfiguration between a particular plugin or a script. For the web server to work efficiently, the administrator need to allocate the appropriate memory size that the application can accommodate.
what is WP_DEGUG ?
WP_DEBUG
is a PHP constant (a permanent global variable) that can be used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php file on development copies of WordPress.
// This enables debugging. define( 'WP_DEBUG', true );
// This disables debugging. define( 'WP_DEBUG', false );
How to Increase PHP Memory Limit in WordPress
- Edit the wp-config.php file on yout wordpress website. The file is located in the WordPress site root folder
- To view the wp-config.php file, you will need an FTP client or the file manager in your web hosting control panel.
- Open the file in your favourite note editing app and paste this code in wp-config.php file.
- Make sure the code is placed before the line that says ‘That’s all, stop editing! Happy blogging.’
1 | define( 'WP_MEMORY_LIMIT', '512M' ); |
The above code tells WordPress to increase the PHP memory limit to 256MB.
That is it your site should be back online. First set wp_debug to true and next edit wp-config.php file.
Happy Blogging.