How do you debug a LONG RUNNING php script?

前端 未结 1 1513
清酒与你
清酒与你 2021-01-27 23:16

The problem is that the script hangs up after some long time. strace returns something like this and nothing else:

Process 7286 attached - interrupt to         


        
1条回答
  •  走了就别回头了
    2021-01-27 23:42

    Xdebug does not have functionality for this. Using pcntl_signal and then using xdebug_print_function_stack is an option, but what you can also do is to create a "function trace". This is something that makes Xdebug write every function call to disk as soon as they happen. This should be able to tell you where your script hangs. From what I can see though is that is waiting for IO.

    There is more information about function traces at http://www.xdebug.org/docs/execution_trace

    0 讨论(0)
提交回复
热议问题