How can I get PHP to produce a backtrace upon errors?

后端 未结 11 2130
無奈伤痛
無奈伤痛 2020-11-28 23:29

Trying to debug PHP using its default current-line-only error messages is horrible. How can I get PHP to produce a backtrace (stack trace) when errors are produced?

11条回答
  •  时光说笑
    2020-11-29 00:17

    Xdebug prints a backtrace table on errors, and you don't have to write any PHP code to implement it.

    Downside is you have to install it as a PHP extension.

提交回复
热议问题