HTML5 Zone is brought to you in partnership with:

Paulund is a website dedicated to writing tutorials and code snippets about Web Development, the main subjects are PHP, Wordpress, jQuery, CSS3 and HTML5. Paul is a DZone MVB and is not an employee of DZone and has posted 137 posts at DZone. You can read more from them at their website. View Full User Profile

Increase WordPress Memory Limit

10.21.2012
| 3252 views |
  • submit to reddit

A common error you can come across in WordPress is a PHP memory limit error. This happens when WordPress doesn't have enough memory to achieve what you want. It can be caused by poorly written plugins that will continue to run a procedure until the installation runs out of memory.

Since version 2.5 there is a wp-config.php option WP_MEMORY_LIMIT which allows you to configure the maximum amount of memory that can be used by PHP.

When you change this option in the wp-config.php it will only affect your WordPress site and not any other PHP sites.

The default memory allocated to WordPress is 32MB, if the value in the php.ini is more than the allocated WordPress amount WordPress will use this value. For example if WordPress has allocated 32MB of memory and php.ini is configured to 64MB then WordPress will use 64MB.

To change the WordPress memory limit you just add the following into the wp-config.php.

define('WP_MEMORY_LIMIT', '64M');

If this doesn't change your allocated memory limit your hosts may not allow you change this setting, if this is the case you should contact your hosting company.

 

 

 

Published at DZone with permission of Paul Underwood, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)