Tip: Checking WordPress for Low PHP Memory Limit

Posted by on Feb 16, 2011 in Tips, Troubleshooting

Some WordPress installs run out of available PHP memory because the memory limit is set too low.
This can cause random errors or white screens that show no error at all. This is a good troubleshooting checklist for any WordPress plugin that is acting strange.

Check the PHP Memory Limit:
Install this WordPress plugin to see the PHP Memory Limit and Memory Usage at the footer of the WordPress admin dashboard:
WP Memory Load and db size Usage

Good example of memory usage:
db 4.505M ~ Mem 21.3 of 128M

Bad example of memory usage:
db 4.505M ~ Mem 21.3 of 32M

Compare the usage to the limit. If the memory usage is close to and within 32M of your limit, try increasing it:

Memory usage is dynamic, meaning that when you are uploading images, the memory usage can easily double temporarily.

Try one of these methods for increasing the amount of memory a
PHP script may consume (most people just do #3)

1. If you have access to your PHP.ini file, edit the PHP.ini
try increasing it:
memory_limit = 128M;

2. If you don’t have access to PHP.ini try adding this to an .htaccess file in the root directory of your site:
php_value memory_limit 128M

3. Try adding this line to your wp-config.php file:
define('WP_MEMORY_LIMIT', '128M');

4. Talk to your web host about their recommended solution.
If your web host will not allow a sufficient memory limit, consider a different web host.
My web host HostGator allows me 256M memory limit.

Troubleshooting WordPress problems:
See this help page: How to troubleshoot what is causing errors in WordPress

HostGator Linux Web Hosting
If you have a web site, you will want it to be fast and reliable. I have researched many web hosting providers to find for you which one is the best. I recommend HostGator Web Hosting. This site and all my other sites are hosted there. Not only are the prices great, they also offer the most features. I have had dedicated servers for many years in the same data center and they were very reliable.

Be sure to select “Linux Web Hosting” when you start your hosting account. If your web site requires any interactive scripts like contact forms, blogs, forums, e-commerce, etc. then I very highly recommend “Linux Web Hosting” rather than “Windows Web Hosting” because I have fewer problems with it.
To start your web hosting account today, click here: HostGator Web Hosting … Mike

Do you need help?

Send us a Donation:

Donate to Mike Challis