Fatalerror: Allowedmemorysizeof33554432bytesexhausted

Source: Internet
Author: User
Today, I changed a server to run php for a long time and I will find the Fatalerror: Allowedmemorysizeof33554432bytesexhausted prompt. next I will introduce this problem to you... today, I changed a server to run php for a long time and I will find the Fatal error: Allowed memory size of 33554432 bytes exhausted prompt. next I will introduce the solution to this problem.

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

Define ('WP _ MEMORY_LIMIT ', '64m'); 64 M can be higher, 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

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.


Tutorial address:

Reprinted! But please include the article address ^

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.