Fatal error: Allowed memory size of 8388608 bytes exhausted

Fatal error: Allowed memory size of 8388608 bytes exhausted

A error often occurred while the system just installed without further adjustment.

This problem is caused by the memory limit of a single PHP script memory restriction.

To solve this problem,

1. Stop apache/IIS/other web service
2. Locate php.ini
3. Modify the following line

memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)

You may modify the reasonable value according to your server configuration.

For example, you can adjust the value to 32, as following,

memory_limit = 32M ; Maximum amount of memory a script may consume (8MB)

This is the one way for the global php configuration.
If you want to modify single php access, you may just add the following code to the specific php file,

ini_set(“memory_limit”,”32M”);

4. Restart the web service.

Retry the function which should work normally.

Advertisements

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