PHP explains how to modify the memory_limit memory limit. Today, I installed the php environment on my new server, but the error "FatalError: Allowedmemorysizeofxxxxxxbytesexhausted" is displayed at runtime. the memory is insufficient, next, I will introduce how to solve this problem. Today, my new server has installed the php environment, but the system prompts Fatal Error: Allowed memory size of xxxxxx bytes exhausted at runtime. this is because the memory is insufficient, next I will introduce several solutions to these problems.
Solution
Method 1: edit php. ini in php. ini.
Find "memory_limit". if not, you can add this parameter at the end of the file. The following are some configuration examples:
Memory_limit = 128 M; you can change M to any value you want to set.
Method 2:. htaccess
Note: This method takes effect only when php is executed using the Apache module. Find the ". htaccess" file in the root directory of your website. if not, create one by yourself. Then put the following configuration into it:
Php_value memory_limit 128 M; you can change M to any value you want to set.
Method 3: modify the php memory settings at runtime
Add the following command line to your php code.
Ini_set ('memory _ limit ', '128m ');
Reminder
If you use php5.2.17, the above method may not work for you. this official bug cannot solve some problems, and we can only reinstall the php environment, such as php5.4.
Internal Error: Allowed memory size of xxxxxx bytes exhausted. the memory is insufficient. here I will introduce the solution...