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 ^