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.