PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 41007872 bytes)

前端 未结 4 642
半阙折子戏
半阙折子戏 2021-01-24 15:26

I\'m getting this error when I try to call the mail() function.

I tried adding ini_set(\'memory_limit\', \'64m\') to my index.php file - Which include()\'s

4条回答
  •  太阳男子
    2021-01-24 16:22

    If setting your memory_limit higher and higher doesn't work, maybe you have an endless-loop somewhere which allocates memory space until the limit is reached.
    I'm not sure how save the str_replace() function is, but it might create an endless-loop here:

    str_replace("\n.", "\n..", $message);
    

    "\n." is being replaced with "\n.." ==> "\n.." might be replaced with "\n..." ==>.... And you are using more and more memory until you reached the limit

提交回复
热议问题