Techyou labs
真正的爱应该超越生命的长度,心灵的宽度,灵魂的深度
常用标签

以前分析xdebug用的是(wincachegrind)http://sourceforge.net/projects/wincachegrind/

现在直接安装webgrind来调试速度会更好
http://xdebug.org/

下载地址:

Source:

* xdebug 2.0.3

Windows modules:

* PHP 5.1.2-5.1.7
* PHP 5.2.1-5.2.6
* PHP 5.3.0dev

windows

1. 编辑php.ini,先注释掉zend:
[Zend]
;zend_extension_ts = “D:\Xampp\php\zendOptimizer\lib\ZendExtensionManager.dll”
2. 启用x-debug
[xdebug]
zend_extension_ts = “D:\Xampp\php\ext\php_xdebug-2.0.0-5.2.2.dll”;必须为完整路径
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir=”D:\Xampp\tmp\xdebug”

linux

1. 安装xdebug扩展
sudo pecl install xdebug
2. 编辑php.ini,启用x-debug
[xdebug]
zend_extension_ts = “/usr/lib/php5/xdebug.so” ;必须为完整路径
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir=”/tmp”

webgrind

http://code.google.com/p/webgrind/

下载地址:http://webgrind.googlecode.com/files/webgrind-release-0.81.zip

1. 下载webgrind,解压缩到web目录
2. 首先访问需要优化的php程序,get/post请求中加入XDEBUG_PROFILE
例如info.php,http://localhost/info.php?XDEBUG_PROFILE
3. 然后访问:http://localhost/webgrind/
默认auto,即为刚刚请求的文件profile,[update]!
程序不兼容IE(本机测试winxp+ie6),如果点了update之后毫无反应,请使用firefox。
webgrind_large.png

暂无评论

添加新评论