Installing plug-ins caused wordpress to start having fatal errors like this one:
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 58368 bytes) in /vservers/h182107wp/htdocs/wp-admin/includes/upgrade.php on line 1294
Some over times activating plugins didn’t cause any specific error but I noticed that the list of posts was showing up as blank and the editing section for a new post wasn’t loading.
I looked around (thanks to the fatal error messages) and found a memory allocation issue:
http://perishablepress.com/press/2008/02/17/wordpress-error-fix-increase-php-memory-for-cachephp/
In short, 3 stages to a manual solution:
1. open the file wp-includes/cache.php
and place the following code immediately after the opening <?php
tag:
1 |
ini_set('memory_limit','32M'); // set memory to prevent fatal errors |
2. create an htaccess file for the wp-includes
directory and insert the following directive:
1 2 |
# set memory limit for cache.php php_value memory_limit 32M |
3. create a local php.ini
file in the same directory (wp-includes
) and insert this:
1 2 |
;; set memory limit for cache.php memory_limit = 32M |
This solution did not work for me. I had to call my host and ask them to change the settings on their end. All manual changes in files did not override the server settings.
The memory allocation change fixed all problems – fatal errors disappeared + no more blank pages, section and spots on the blog.