facing a PHP Fatal Error: Out of memory error in your WordPress website ? This is one of the most common errors in WordPress, which you can easily fix it by increasing the Php memory limit in WordPress setup website. In today article, we will show you how to fix Fatal error: Out of memory error in worpdress.
Increase PHP Memory Limit in WordPress to Fix Fatal error: Out of memory worpdress
To increase memory limit in WordPress site need to edit the wp-config.php file which is located in WordPress site’s root folder, with use of FTP access or CPanel > File Manager you able to easily reach at WordPress setup root directory and find wp-config.php file which you need to edit for Fix Fatal Error: WordPress Memory Exhausted Error by Increase PHP Memory.
Next, Add following WP_MEMORY_LIMIT line in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’
// increase memory limit in WordPress define( 'WP_MEMORY_LIMIT', '512M' ); // change 512M according need
Above code tells WordPress to use memory limit ‘512M’ instead of default memory limit avail in WordPress setup server and this way we able to increased the PHP memory limit and fix Fatal error: Out of memory worpdress / WordPress Memory Exhausted Error
If you getting errors while working in the wp-admin area of WordPress, try adding the WP_MAX_MEMORY_LIMIT code beneath the memory limit code,
// increase memory limit in WordPress define('WP_MEMORY_LIMIT', '512M' ); // change 512M according need define('WP_MAX_MEMORY_LIMIT', '128M');
WP_MEMORY_LIMIT = WordPress front end
WP_MAX_MEMORY_LIMIT = WordPress back end
Make sure, for safety you taken original file backup before edit wp-config.php and uploaded / Save edited wp-config.php in WordPress setup Root directory. in case it anything wrong happen than upload back your backup file and contact our Experience WordPress Developer who ready to help in solve Fatal Error: WordPress Memory Exhausted Error in free of cost 🙂
After increased Memory limit with edit wp-config.php now visit your WordPress site and memory exhausted error should disappear now.
Important Note: If given above solution not work for you, then it means your hosting service provider not allow to increase PHP memory limit by editing wp-config.php file. and you need to contact your web hosting support team and request them to increase PHP memory limit manually for your WordPress hosting account.
If you Fixed WordPress Memory Exhausted Error by Increase PHP Memory in any other way please share in comment.
Enjoy Life 🙂