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