xdebug与wincachegrind配置

  xdebug为代码调试var_dump的输出带来了很大的方便,但是对于一个代码编写熟练的老手来说,xdebug的错误调试功能也就不是那么重要,因为那些老手可以用echo,print_r,var_dump在加上自己的思维与经验在程序需要的未知输出结果来定位代码的错误的位置。

   但是我写这篇文章的意义不在于调试bug的。而是让xdebug来帮助我们分析代码的执行效率。

废话少说:

php.ini中xdebug的配置

[Xdebug]
zend_extension="D:/xampp/php/ext/php_xdebug.dll"
xdebug.auto_trace=On
xdebug.collect_params=On
xdebug.collect_return=On
xdebug.profiler_enable=On
xdebug.profiler_output_name = cachegrind.out.%p
xdebug.trace_output_dir="E:/php_xdebug/debuginfo"
xdebug.profiler_output_dir="E:/php_xdebug/debuginfo"

其中保存调试的代码为

xdebug.profiler_output_name = cachegrind.out.%p
为设置保存调试的文件类型。大家知道wincachegrind只能读取cachegrind.out.*文件。

所以output的文件名要设置成cachegrind.out.%p。那个%p是服务器的pid


你可能感兴趣的:(PHP,ext,Zend)