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

前端 未结 4 634
半阙折子戏
半阙折子戏 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:08

    The characters you have provided for the replacement may be causing the str_replace function to loop endlessly.It is not a good idea either to be playing around with setting the maximum memory limit for php. Try another string function. Maybe:

    $message = preg_replace("\n.", "\n..", $message);
    

    preg_replace is very good with such characters and may not run in many useless loops without knowing what to do.

    I hope this helps.

提交回复
热议问题