Fatal error:allowed memory size of 33554432 bytes exhausted_php Tutorial

Source: Internet
Author: User
Tags wordpress blog
Today changed a server to run PHP for a long time will find fatal error:allowed memory size of 33554432 bytes exhausted hint, I would like to introduce you to this issue to solve the problem.

Solutions


Method One (recommended), modify the Memory_limit in the PHP.ini setting value 8M to 120m:memory_limit = 120M

Method Two, in the top-level PHP Script, add a line: Ini_set ("Memory_limit", "120M");


I use WordPress blog, my solution is a little different, the following also share a bit.

1, network method, it is said that this applies to 3.0 previous versions. Edit wp-config.php This file, add

The code is as follows Copy Code

Define (' Wp_memory_limit ', ' 64M ');

64M can be higher. Can be 96M, 128M.

2, 3.0 after the version, to modify the source files, you do not have to change the mind. Locate the following code in the default-constants.php file in the Wp-includes 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 ');
}
}

The second line define (' Wp_memory_limit ', ' 32M '); 64M can be changed.

http://www.bkjia.com/PHPjc/633193.html www.bkjia.com true http://www.bkjia.com/PHPjc/633193.html techarticle today changed a server to run PHP for a long time will find fatal error:allowed memory size of 33554432 bytes exhausted hint, I would like to introduce you to this issue to solve the problem. Solve ...

  • 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.