XDebug 是一个 php 代码的调试工具, 对程序员调试程序有很大的帮助, 下面简单说下 XDebug 在 Windows 下的配置.
1. 下载XDebug二进制文件: http://www.xdebug.org/download.php
5.2 http://www.xdebug.org/files/php_xdebug-2.1.0-5.2-vc6.dll
5.3 http://www.xdebug.org/files/php_xdebug-2.1.0-5.3-vc6.dll
2. 找到php.ini
3. 如果配置过 ZendOptimizer, 需要先屏蔽 ZendOptimizer 有关的配置, 通常如下:
[Zend]
zend_extension_manager.optimizer_ts="path\ZendOptimizer-3.3.0\lib\Optimizer-3.3.0"
zend_extension_ts="path\ZendOptimizer-3.3.0\lib\ZendExtensionManager.dll"
4. 加入 XDebug 配置:
zend_extension_ts="path/xdebug/php_xdebug-2.1.0-5.2-vc6.dll"
[Xdebug]
xdebug.profiler_enable=on
xdebug.trace_output_dir="path\xdebug"
xdebug.profiler_output_dir="path\xdebug"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
说明: 上面 "path" 的地方需要修改为你自己的本地路径.
5. 重启 Apache 或者 IIS.
6. 查看 phpinfo 的输出, 如果看到 XDebug 的选项, 就说明配置成功了.
以下是其他网友的文章
一、安装xdebug模块
1、去www.xdebug.org下载相应版本php的模块文件,保存下载后的文件到php的ext目录,可以自己修改文件的名称,如保存成:php_xdebug.dll
2、修改php.ini,增加如下信息
代码如下:
[Xdebug]
zend_extension_ts="c:/webserver/php5/ext/php_xdebug.dll"
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_dir="c:/webserver/php5/debuginfo"
xdebug.profiler_enable=on
xdebug.profiler_output_dir="c:/webserver/php5/debuginfo"
参数解释:
zend_extension_ts="c:/webserver/php5/ext/php_xdebug.dll"
;加载xdebug模块。这里不能用extension=php_xdebug.dll的方式加载,必须要以zend的方式加载,否则安装上后,phpinfo是显示不出xdebug这个项的。
xdebug.auto_trace=on;
;自动打开“监测函数调用过程”的功模。该功能可以在你指定的目录中将函数调用的监测信息以文件的形式输出。此配置项的默认值为off。
xdebug.collect_params=on;
;打开收集“函数参数”的功能。将函数调用的参数值列入函数过程调用的监测信息中。此配置项的默认值为off。
xdebug.collect_return=on
;打开收集“函数返回值”的功能。将函数的返回值列入函数过程调用的监测信息中。此配置项的默认值为off。
xdebug.trace_output_dir=”c:\Temp\xdebug”
;设定函数调用监测信息的输出文件的路径。
xdebug.profiler_enable=on
;打开效能监测器。
xdebug.profiler_output_dir=”c:\Temp\xdebug”;
;设定效能监测信息输出文件的路径。
还有一些更为具体的参数设定,详见:http://www.xdebug.org/docs-settings.php
3、重启apache
这样,在本地运行php的时候,会在所设定的目录里产生一些调试信息的文件:
函数调用过程监测信息文件的文件名格式:trace.××××××.xt。这个文件可以直接查看,里面包含了函数运行的时间,函数调用的参数值,返回值,所在的文件和位置等信息。内容格式还是相对直观的。
效能监测文件的文件名格式:cachegrind.out.××××××××。
这个文件也可以直接查看,不过信息格式不易被人类所理解,
所以我们需要接下来的一个软件。
二、安装wincachegrind
由于效能监测文件:cachegrind.out.××××××××文件的内容不易被人类所理解,所以我们需要一个工具来读取它。windows下就有一款这样的软件:wincachegrind。
1、到http://sourceforge.net/projects/wincachegrind/下载安装wincachegrind
2、安装运行后,点击Tools->options,设定你的working folder(php.ini里xdebug.profiler_output_dir的值)
这样就可以比较直观的查看效能监测文件的信息了。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
