Over a million developers have joined DZone.

Increase WordPress Memory Limit

· Web Dev Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

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 by Stormpath—offering a complete, pre-built User Management API for building web and mobile applications, and APIs. Download our new whitepaper: "Build Versus Buy: Customer Identity Management for Web and Mobile Applications".

Topics:

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 }}