Windows下使用PHP Xdebug

首先下载Xdebug的dll:http://xdebug.org/download.php

将dll文件放到php目录下的ext目录里面;

修改php.ini,根据自己的需要增加信息:

[Xdebug]
; 加载xdebug模块
zend_extension_ts=/.../php/ext/php_xdebug.dll 
 
; Xdebug Setting
; 监测函数调用过程
xdebug.auto_trace=1
; 将函数参数列入监测信息
xdebug.collect_params=1
; 将函数返回值列入监测信息
xdebug.collect_return=1
; 打开效能检测器
xdebug.profiler_enable=1
; 将效能信息附加在文件后面,而不是覆盖
xdebug.profile_append=1
; 监测信息输出文件 xdebug.trace_output_dir="..." 
; 效能检测信息输出文件 xdebug.profiler_output_dir="..."

更多的可配置参数在: http://xdebug.org/docs/all_settings

函数调用过程监测信息文件名:trace.xxx.xt,效能监测文件名:cachegrind.out.

效能监测文件可以使用WinCahceGrind软件打开,下载地址是:http://sourceforge.net/projects/wincachegrind/files/wincachegrind/

打开后,在Tools->options里设置Working Folder即可。

// 返回调用函数所在的文件
string xdebug_call_file()
//返回调用所在的行号
string xdebug_call_line()
//返回调用的函数的名字
string xdebug_call_function()
//返回当前内存使用量
int xdebug_memory_useage()
//返回脚本执行到当前地方的时间
float xdebug_time_index()
//停止错误信息的手机
void xdebug_stop_error_collection()
原文地址:https://www.cnblogs.com/cubika/p/3360562.html