开发者

xDebug : Output traces in php script?

开发者 https://www.devze.com 2023-01-01 07:32 出处:网络
I have tried to use xDebug on my local Ubuntu environment to speed up development and it\'s a great asset.

I have tried to use xDebug on my local Ubuntu environment to speed up development and it's a great asset.

Howeve开发者_运维问答r, I would like to see the output of the Trace function directly in the browser, at the end of the script.


The xdebug_start_trace / xdebug_stop_trace functions only write to a file. These are what you are talking about right? But you could then read that file at the very end of your script so it would display.

xdebug_start_trace('/path/to/log');
blah blah
xdebug_stop_trace();
readfile('/path/to/log');

If you need to step through your code regularly though, I would suggest using an external program (http://xdebug.org/docs/remote). Using one of those with xdebug will let you step through your code, set breakpoints, etc...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号