Having your memory_limit be set too low can cause a lot of problems. If you get a blank white screen in your admin area, or if you get an error something like the following:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home/username/public_html/mywordpress/myfile.php(1005)

Then you need to check your memory_limit. (As always, plugins could be problem too, so be sure to deactivate those in testing your problem-fixers).

Put very simply, and according to the WordPress documentation, here are some ways to change this:

  • Increase the amount of memory a PHP script may consume. Note: If using a shared hosting service, you may need to ask your host to increase the limit.
  1. Increase the memory limit setting in php.ini (e.g. memory_limit = 64M ;). Many hosts may not allow this.
  2. Increase the memory limit via .htaccess (e.g. php_value memory_limit 64M). Many hosts may not allow this.
  3. Increase the memory limit via wp-config.php (e.g. define('WP_MEMORY_LIMIT', '64MB');)

My preferred way of doing it, is to use the php.ini file. Here is an example of how to do so with BlueHost, though the tips will likely help with any host that allows you to edit the php.ini file.

First, you will need to install your php.ini file. You can do this from the PHP Config icon in your cPanel.

While you are in the PHP Config area, also set your PHP mode to PHP5 (Single php.ini).

Once your php.ini file has been installed, it will be uploaded under the name php.ini.default and found in your public_html directory(folder). If you have an existing php.ini file in your public_html, rename it to php.ini.bak, then rename your php.ini.default to: php.ini

Once you have done that, you may just find that your problems are solved!

However, you may also find that they are not yet solved, in which case, edit your php.ini, look for the memory_limit line, and make sure it is set to 64M. If it is already set to 64M, try increasing it to 128M.

memory_limit 128M

That should be it! You’re done!

Maybe… If it still doesn’t work, keep reading, otherwise, rejoice and carry on with your life.

Now, if your WordPress site resides in a subfolder of public_html, you may also need to check your .htaccess file within that subfolder.

If you do not have hidden files enabled, you will need to make sure they are enabled, since .htaccess is a hidden file. Make sure that your subfolder’s .htaccess file does not have a line like the following:

AddHandler application/x-httpd-php5 .php <—– This is a bad line for a .htaccess in a subfolder.

If you see such a line, remove it and, if you’d like, replace it with the following line(notice the subtle “s” which makes all the difference in the world… or at least it does on my BlueHost account).

AddHandler application/x-httpd-php5s .php <—– This is a good line

That’s it! Now you can rejoice and be glad!

If you still have problems, drop me a comment, or checkout the WordPress support forums

Be Sociable, Share!