Increasing PHP memory limits

Most Web hosting providers limit the amount of memory any one PHP
script or program file can use on the Web server at any given time. PHP is at
the core of WordPress (see Book II, Chapter 3), and by default, WordPress
attempts to set the PHP memory limit to 32MB. However, if you see PHP
memory limit errors on your Web site, such as

PHP Fatal error: Allowed memory size of 33554432 bytes exhausted
(tried to allocate 6233929 bytes) …

The PHP memory limit needs to be increased to run the PHP script or file.
That memory limit error tells you that the PHP script was attempting to
allocate 64MB of memory; however, the allowed memory size set by the
server is limited to 32MB, which is the reason for the error.

To help resolve the PHP memory limit errors, within the wp-config.php,
define the maximum amount of memory that PHP can use by writing one of
these three lines of code, depending on how much memory you allow PHP to
use on your site, and adding it to the wp-config.php file on its own line:

define (‘WP_MEMORY_LIMIT’, ‘64m’); // increase limit to 64M
define (‘WP_MEMORY_LIMIT’, ‘96M’); // increase limit to 96M
define (‘WP_MEMORY_LIMIT’, ‘128M’); // increase limit to 128M

Some hosting providers disable the ability to increase PHP memory limits on
your Web hosting account, so depending on your hosting environment, your
attempts to increase the memory limit may not work. If you discover this is
the case for your particular hosting account, you can contact your host and
ask him to increase the PHP memory limit for your account or switch to a
different hosting provider.

Advertisements
Increasing PHP memory limits

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s