Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

前端 未结 21 1206
猫巷女王i
猫巷女王i 2020-11-21 22:14

This error message is being presented, any suggestions?

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

21条回答
  •  隐瞒了意图╮
    2020-11-21 23:01

    Your script is using too much memory. This can often happen in PHP if you have a loop that has run out of control and you are creating objects or adding to arrays on each pass of the loop.

    Check for infinite loops.

    If that isn't the problem, try and help out PHP by destroying objects that you are finished with by setting them to null. eg. $OldVar = null;

    Check the code where the error actually happens as well. Would you expect that line to be allocating a massive amount of memory? If not, try and figure out what has gone wrong...

提交回复
热议问题