Show Full Stack Trace on PHP Command Line

落爺英雄遲暮 提交于 2019-12-08 03:23:50

问题


Problem

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)

Expected Outcome

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?


回答1:


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() );
}


来源:https://stackoverflow.com/questions/34498002/show-full-stack-trace-on-php-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!