In this tutorial we’ll show you how to fix a common error that can occur when WordPress runs out of resources.
By default WordPress will try to set aside 40M of memory for PHP. However, there are times where this amount is not enough.
Here are a few examples of the PHP memory error:
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 512 bytes) in /redacted/wp-content/plugins/shopp/core/flow/Order.php on line 2168
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 15552 bytes) in /redacted/wp-content/plugins/shopp/core/model/Image.php on line 29
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 2046199 bytes) in /redacted/wp-content/plugins/shopp/core/DB.php on line 238
Get recommendations on making your WordPress site faster today so you can focus on running your business.
This error can be fixed by increasing the PHP memory that is available to WordPress. The most common method to fix this is to include a constant for the WP_MEMORY_LIMIT within your wp-config.php file. Below are some examples:
define('WP_MEMORY_LIMIT', '96M');
define('WP_MEMORY_LIMIT', '128M');
Increasing the WP Memory Limit
1) Login to your WordPress site with an SFTP or FTP client. We recommend Transmit (for Mac). FileZilla and Cyberduck are free options that is available for multiple platforms.
2) Then browse to your WordPress root or the current location of your wp-config.php file.
3) Open your wp-config.php file with an editor. Next, copy one of the constants mentioned earlier and then paste it towards the middle of your wp-config.php file and save changes.