Fatal error: Out of memory, but I do have plenty of memory (PHP)

前端 未结 20 2667
情歌与酒
情歌与酒 2020-11-29 23:34

Since my question is getting longer and longer, I decide to re-write the whole question to make it better and shorter.

I run my website on dedicated server with 8GB

20条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 00:05

    this happened to me a few days ago. I did a fresh installation and it still happened. as far as everyone sees and based on your server specs. most likely it is an infinite loop. it could be not on the PHP code itself but on the requests made to Apache.

    lets say when you access this url http://localhost/mysite/page_with_multiple_requests

    Check your Apache's access log if it receives multiple requests. trace that request and check out the code that might cause a 'bottleneck' to the system (mine's exec() when using sendmail). The bottleneck im talking about doesn't need to be an 'infinite loop'. It could be a function that takes sometime to finish. or maybe some of php's 'program execution functions'

    You might need to check ajax requests too (the ones that execute when the page loads). if that ajax request redirects to the same url

    e.g. httpx://localhost/mysite/page_with_multiple_requests

    it would 'redo' the requests all over again

    it would help if you post the random lines or the code itself where the script ends maybe there is a 'loop' code somewhere there. imho php won't just call random lines for nothing.

    http://blog.piratelufi.com/2012/08/browser-sending-multiple-requests-at-once/

提交回复
热议问题