WordPress – Allowed Memory Size Exhausted
WordPress is a great blogging platform that has many powerful features. The hosting environment WordPress operates under can provide constraints and limitations.
After upgrading a plugin for WordPress, I immediately encountered the error, “Fatal error: Allowed memory size of x bytes exhausted in…php on line x). All WordPress web pages would display the same fatal error.
A user might expect, that if WordPress is encountering a fatal error with a plugin, the plugin would be disabled. This process is not automated.
Solution – Short-term:
Disabling the WordPress plugin required manually editing the WordPress database and disabling all plugins. Under the table containing the name “options” and under the column named “option_name” with the value of “active_plugins”, I erased the option_value. The option_value contains a setting of which plugins are activated and which are not. By removing the values in option_value, all plugins will be disabled. This approach allows plugins to be re-activated one by one until the fatal error is encountering, thus allowing the troubling plugin to be identified.
MySQL database command to view the option_value:
SELECT * FROM `options` WHERE option_name='active_plugins'
MySQL database command to reset and disable all plugins:
UPDATE `options` SET `option_value`='' WHERE option_name='active_plugins'
Solution – Long-term:
WordPress is powered by PHP and hosting environments set limits on the amount of memory PHP can consume for each customer or instance. If WordPress is legitimately in need of more memory, it will be best to increase the PHP memory limit for the user or instance. The method of increasing the memory limit varies based on the way PHP has been configured on the server. Some common solutions are to add or edit a file called php.ini or php5.ini with a line, “memory_limit = 128M”. Common values for the memory limit include: 32M, 64M, and 128M.
For a shared hosting environment, the most reliable approach is to contact the system administrator.
When encountering a fatal error involving memory consumption, a likely root cause could be a plugin. The easiest route to identify whether a plugin is the root cause is to disable all plugins. If disabling all the plugins resolves the memory exhaustion issue, re-enabling one-by-one will identify the offending plugin.
Fatal error: Allowed memory size exhausted
How To Disable All WordPress Plugins From The Database?
Leave a Reply