在PHP命令行上显示完整堆栈跟踪 [英] Show Full Stack Trace on PHP Command Line
本文介绍了在PHP命令行上显示完整堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问题
我的PHP Stack Trace的缩写:
My PHP Stack Trace is abbreviated:
Stack trace:
#0 /www/html/table/app/create.php(128): SoapClient->__call('call', Array)
#1 /www/html/table/app/create.php(128): SoapClient->call('5e81ad4c12668ec...', 'table.ad...', Array)
预期结果
从命令行运行php时,我想查看被 ... 隐藏的部分.如何使php显示完整消息?
I want to see the part that is hidden by the ... when running php from the command line. How do I make php show the full message?
推荐答案
您可以将其放在try ... catch
中,然后对异常进行var_dump
.
You can surround it in a try ... catch
and then do a var_dump
on the exception.
try {
// the code that throws an exception
} catch ( Exception $e ) {
var_dump( $e->getTrace() );
}
这篇关于在PHP命令行上显示完整堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文