Over a million developers have joined DZone.
Platinum Partner

Increase WordPress Memory Limit

· Web Dev Zone

The Web Dev Zone is brought to you in partnership with Mendix.  Discover how IT departments looking for ways to keep up with demand for business apps has caused a new breed of developers to surface - the Rapid Application Developer.

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.




The Web Dev Zone is brought to you in partnership with Mendix.  Learn more about The Essentials of Digital Innovation and how it needs to be at the heart of every organization.


Published at DZone with permission of Paul Underwood , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}