自从安装了xdebug后,发现每次调试都须要从eclipse中先从头启动,而后一步步走到你要调试的页面,而不是说想何时调试就何时调试。php
以前用zenddebugger的时候则是能够在任意页面启动调试,直接从浏览器通知开发环境须要调试。而不用先从开发环境启动调试。随时须要调试的时候就能够执行调试。chrome
后来发现了chrome浏览器有一款插件叫xdebug helper,火狐下也有easy xdebug,下面主要来讲chrome下的xdebug helper浏览器
安装完成xdebug helper后再浏览器地址栏的右侧可以看到一只小爬虫,点击后以下图所示:session
选择Debug,就会通知你的开发环境接下来的代码须要开始调试,选择disable,就会直接运行。app
在eclipse中须要进行特别的设置:eclipse
进入window->Preferences->PHP->Debug
找到配置xdebug中的Accept remote session(JIT),选择为localhost,并保存。函数
在PHP的配置文件中对xdebug的设置须要特别注意,将xdebug.remote_autostart设置为off,若是设置为on,则会忽略在浏览器中是选择Debug仍是Disable,都会通知eclipse进行调试spa
xdebug.remote_autostart = Off
这样,xdebug helper就设置好了.net
如下是个人php.ini中对xdebug的配置插件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
[Xdebug] ;xdebug配置
zend_extension="e:/php/ext/php_xdebug-2.2.1-5.4-vc9.dll" ;载入Xdebug
xdebug.profiler_enable=on
xdebug.trace_output_dir="e:/xdebug-log" ;xdebug 的数据文件目录
xdebug.profiler_output_dir="e:/xdebug-log" ;xdebug 的数据文件目录
xdebug.auto_trace = On ;开启自动跟踪
xdebug.show_exception_trace = On ;开启异常跟踪
xdebug.remote_autostart = Off ;开启远程调试自动启动
xdebug.remote_enable = On ;开启远程调试
xdebug.remote_handler=dbgp ;用于zend studio远程调试的应用层通讯协议
xdebug.remote_host=127.0.0.1 ;容许链接的zend studio的IP地址
xdebug.remote_port=9000 ;反向链接zend studio使用的端口
xdebug.collect_vars = On ;收集变量
xdebug.collect_return = On ;收集返回值
xdebug.collect_params = On ;收集参数
xdebugbug.max_nesting_level = 10000 ;若是设得过小,函数中有递归调用自身次数太多时会报超过最大嵌套数错
|