How to trace PHP errors?

前端 未结 5 520
独厮守ぢ
独厮守ぢ 2021-01-14 01:51

I get the following error:

[23-Feb-2011 19:51:29] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 512 bytes) in /obj/cla         


        
5条回答
  •  甜味超标
    2021-01-14 02:04

    In php you can set your own exception handler and error handler, see also documentation on php.net. When an error occurs you can print backtrace and dump that to file or screen.

    Look at the php functions:

    set_exception_handler()
    set_error_handler()
    debug_backtrace();
    

    Hope it helps, Greetz, Erwin Haantjes

提交回复
热议问题