Common problem PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...

Common problem PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...

background

When we develop daily, we will encounter all kinds of strange problems (step on the pit o(╯□╰)o), this FAQ series is a series of record articles about some of the problems I encounter every day, organized here After summarizing, share it with everyone, so that his friends who are still in the deep pit can climb out with a rope.
At the same time, everyone is welcome to leave a message or private message me with the problems you encounter, and I will see if I can solve them for you.

development environment

  • System: windows10
  • Language: PHP

content

mistake

Fatal error: Allowed memory size of 314572800 bytes exhausted (tried to allocate 20480 bytes) in...

Cause of:

The memory used when operating a certain data exceeds the maximum limit, resulting in memory overflow that cannot be effectively occupied.

solution:

1. Set memory_limit to 512M in php.ini
2. Add ini_set("memory_limit", "512M"); statement in the program

This article declares:
88x31.png
Creative Commons License
This work is licensed by CN Hua Shao under the Creative Commons Attribution-Noncommercial 4.0 International License.

Guess you like

Origin blog.csdn.net/csde12/article/details/125615469