Fatal error: Allowed memory size of 33554432 bytes exhausted

Source: Internet
Author: User
Tags php file php script versions wordpress blog

Solution


Method 1 (recommended) change the value of memory_limit in php. ini to 120 M: memory_limit = 120 M.

Method 2: Add a line to the top-level PHP Script: ini_set ("memory_limit", "120 M ");


If I use a wordpress blog or not, my solution is a little different. Let's share it with you.

1. Network method. It is said that this is applicable to versions earlier than 3.0. Edit the wp-config.php file, add

The code is as follows: Copy code

Define ('WP _ MEMORY_LIMIT ', '64m ');

64 m can be higher. It can be 96 M, 128 M.

2. For versions later than 3.0, you don't need to change the source file if you want to modify the source file. Find the following code in the default-constants.php file under the wp-Ides Directory

The code is as follows: Copy code

Global $ blog_id;

// Set memory limits
If (! Defined ('WP _ MEMORY_LIMIT ')){
If (is_multisite ()){
Define ('WP _ MEMORY_LIMIT ', '64m ');
} Else {
Define ('WP _ MEMORY_LIMIT ', '32m ');
}
}

Line 2: define ('WP _ MEMORY_LIMIT ', '32m'); change to 64 MB.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.