在PHP命令行上显示完整堆栈跟踪

JMC*_*JMC 2 php debugging php-5.3

问题

我的PHP Stack Trace缩写为:

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)
Run Code Online (Sandbox Code Playgroud)

预期结果

我想从命令行运行php时看到被...隐藏的部分.如何让php显示完整的消息?

Mat*_*ark 5

您可以将其包围在a中try ... catch然后var_dump对异常执行操作.

try {

    // the code that throws an exception
} catch ( Exception $e ) {

   var_dump( $e->getTrace() );
}
Run Code Online (Sandbox Code Playgroud)