A problem has been bugging me for quite a while now. Occasionally when working within the WordPress admin pages, checking the stats, updating posts, etc, a blank, all white page will be returned. When this happens the following error is output to the logs.
PHP Fatal error: Out of memory (allocated 42467328) (tried to allocate 67105 bytes) in (docroot)/wp-content/plugins/jetpack/modules/stats.php on line 448
If you’ll notice, WordPress isn’t exactly asking for the moon. It’s using about 40MB of memory, and only asking for 70KB more. Surely, I should be well in the clear with this, especially since I’ve configured every memory setting I can think of upwards of 256MB.
This is a pretty common problem with the PHP script serving the WordPress site requiring more memory than is available or allowed. There are a number of suggested fixes, described below, but none worked for me, and I managed to simply work around the issue (by deactivating plugins) for quite a while. This wasn’t altogether satisfactory, and today I had no ‘superfluous’ plugins to deactivate, so I dug deeper into the world of hosting and PHP multi-user configuration.
Thankfully, I found the silver bullet, and have (hopefully) banished the White Screen of Death forever. If you’ve encountered the same problem, simply follow the steps below to solve the issue.
Step 1: Disable Plugins
This is the least helpful solution. But, if you are running out of memory, you can try simply using less memory. Once you’ve pared down your plugins to the minimum that you require, you’re going to have to actively increase the memory available to WordPress and/or PHP.
Step 2: Increase the WordPress Memory Limit
The next step is to check your
wp-config.php file to ensure that WordPress is permitting itself enough memory. If this is the problem, you won’t be getting PHP fatal errors, but it may still present itself with the White Screen of Death. To increase the WordPress memory limit, add the following line to your
256MB is more than enough for any WP site, but this will help diagnose where the issue lays. You may want to dial this back after things are working right. If that still doesn’t do the trick, it’s time to make sure that your server’s PHP memory limit is sufficient.
Step 3: Increase the Server PHP Memory Limit
You may not have access to your server’s PHP settings. So, to check and see what the memory limit is, you need to run a PHP Info utility. You can simply install the “PHP Server Info” plugin which displays the
phpinfo() on a page in your admin screen. However, if you’re running into memory problems and can’t install another plugin, add a file named “phpinfo.php” to your WordPress document root with the following contents. Important: Be sure to delete this file after you’re finished, it’s not something you want publicly accessible.
// Show all information, defaults to INFO_ALL
Point your browser at http://
memory_limit, and check to see if it’s too low.
If yours is set to 16M or 32M, then this could be the culprit. You may want to bump it up to 256M while you’re troubleshooting, and find a suitable value once you’ve solved the problem. You can change this setting by editing or adding the following line in your server’s
PHP.ini file (you may have to have your hosts do this).
memory_limit = 256M;
On my server, the PHP memory limit was set to 128M, which again is more than enough for the 40MB that I needed. Unfortunately, there didn’t seem to be any other solutions that I could try. As a result, I simply avoided the problem by disabling some plugins that I wanted, but could live without. This kept my memory usage under 40MB, but it was hardly an ideal solution. When I bumped up against the White Screen of Death again, and was out of plugins I could live without, I sought a proper solution. Fortunately I found it.
Step 4: Increase Server User Memory Limit
After some serious google sleuthing, I discovered that most hosts utilize various tools to limit the memory and CPU that each user can utilize. This makes sense, but naturally, can lead to lower available memory limits than PHP or WordPress thinks they are permitted.
What fixed the problem for me was increasing the Apache RLimitMEM to its max size. This can be set in the Apache configuration files or in your server’s
.htaccess file. I didn’t have access to the Apache config files on my server, but I was able to access the
.htaccess file. You may need to contact your host to do this.
To increase the amount of memory available to your hosting server user, simply modify or add the following line to your
Once I added that line, like magic, my White Screen of Death issues have disappeared. My WordPress install had been throttled by a somewhat obscure Apache setting, but now it was free to stretch its legs a bit. Hopefully this will work for you, and finally enable your true WordPress potential.
Many photographers struggle with the decision whether or not to add a watermark to their photos, balancing the elegance of a photograph against a desire for accreditation, sometimes even compensation, for their creative works, works that are so frequently stolen shared without permission by the online community. For my own purposes, I choose not to watermark the photographs that I post on Flickr, Facebook, or other sources. Through these media, I
This is a quick note for everybody out there who has suddenly found their mail acting up after upgrading their iPhone/iPad to iOS 6. The Problem I first noticed the issue just as I was about to send an email. Fortunately, I was lucky enough to spot the problem before I sent it off, thereby narrowly avoiding an embarrassing incident. See if you catch it below. Egads that was close! But what is