您的位置:首页 > 编程语言 > PHP开发

zend studio8.x下的调试-zenddeugger的安装配置,以及xdebug的使用

2012-10-23 14:33 603 查看

1.下载ZendDebugger.dll

http://download.csdn.net/download/wm5920/4677516

2.在服务器目录下新建一个phpinfo.php,内容如下:

<?php
phpinfo();
?>


在浏览器地址栏下输入http://localhost/phpinfo.php查看配置信息,

找到Loaded Configuration File对应的配置文件打开并在最后一行添加如下代码:

[Zend]

zend_extension_ts="F:/xdebug/ZendDebugger.dll"

zend_debugger.allow_hosts=127.0.0.1/10

zend_debugger.expose_remotely=always      

其中zend_extension_ts对应你下载的ZendDebugger.dll所存放的目录

3.重启apache,刷新http://localhost/phpinfo.php,你会看到如下信息

表示安装成功!

4.配置Installed Debuggers

打开菜单栏windows-preference-PHP-Debug-Installed Debuggers,点击configue,配置如下



5.拷贝dummy.php文件到根目录下,与phpinfo.php在同一目录下,也可以自己写个php文件,只要写上如下代码:

<?php
@ini_set('zend_monitor.enable', 0);
if(@function_exists('output_cache_disable')) {
@output_cache_disable();
}
if(isset($_GET['debugger_connect']) && $_GET['debugger_connect'] == 1) {
if(function_exists('debugger_connect'))  {
debugger_connect();
exit();
} else {
echo "No connector is installed.";
}
}
?>


6.调试时以php web page调试,点击Test Debugger会弹出success提示框,至此配置完成!



7.xdebug

php.ini配置信息

[xdebug]

xdebug.auto_trace = on

xdebug.collect_params = on

xdebug.collect_return = on

xdebug.trace_output_dir = "F:/xdebug/trace"

xdebug.profiler_enable = on

xdebug.profiler_output_dir = "F:/xdebug/profiler"

xdebug.remote_enable = on

xdebug.remote_host = 127.0.0.1

xdebug.remote_port = 9000

xdebug.remote_handler = dbgp

xdebug.extended_info = on

用phpinfo()查看安装信息

8.用wincachegrind查看Xdebug调试信息

打开后点击Tools->options,设定你的working folder(php.ini里xdebug.profiler_output_dir的值C:\Temp\xdebug)这样就可以比较直观的查看效能监测文件的信息了。

9.关于xdebug的“Unexpected termination of script, debugging ended”

看一下错误的描述

You can also type in an expression by right-clicking inside the Expressions view and selecting “Add Watch Expression”.

Important Note: There appears to be a bug when you try to launch a debug session with existing Watch Expressions. You get an error “Unexpected termination of script, debugging ended”. To avoid this error, just delete all Watch expressions, using the “Remove
All Expressions” button in the toolbar, prior to starting a new debug session.

To finish up, delete the Watch expression and press the red Terminate button to stop the debug session.

这种问题至今没有解决。。。。,还好这种错误出现的不是非常频繁,有足够调试的时间
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: