xdebug_start_trace();/* 业务代码 */xdebug_stop_trace();
1、最简单经典的var_dump()
2、配置error_log,能够解决很多疑难杂症
3、firebug + firephp或者chrome + chromephpphp调试指南:http://heiyeluren-doc.googlecode.com/files/php-debug-manual-public.pdf
挺薄的一个册子,讲的不错。xhprof 吧,
facebook开源出来的神器,php轻量级调试工具,可在生产环境中使用。
1. inclusive time :包括子函数所有执行时间。
2. exclusive time/self time:函数执行本身花费的时间,不包括子树执行时间。
3. wall time:花去了的时间或挂钟时间。
4. cpu time:用户耗的时间+内核耗的时间
5.inclusive cpu:包括子函数一起所占用的cpu
6.exclusive cpu:函数自身所占用的cpu 我比较喜欢笨方法print_r + exit来调试代码。php 5.6 新增 phpdbg,使用方法上类似于gdb。
官方货.gdb xdebugxdebug可以结合;ide 进行断点调试
phpstrom+xdebug + chrome(debug helper) or ff (easy xdebug)macgdbp xdebug chromephp
