环境
zend studio10 php5.4.17 xdebug2.2.3-5.4-vc9
下载
- 先用phpinfo();函数查看下自己的php是哪个版本的,是否线程安全的。下载地址:http://www.xdebug.com/download.php
- 解压到ext文件下面
配置
- 打开php.ini文件,添加以下内容:
-
[xdebug] zend_extension="e:/wnmp/php/ext/php_xdebug-2.2.3-5.4-vc9.dll" xdebug.default_enable=on ;开启自动跟踪 xdebug.auto_trace=on ;开启异常跟踪 xdebug.show_exception_trace=on ;开启远程调试自动启动 xdebug.remote_autostart = Off ;收集参数 xdebug.collect_params=on ;收集返回值 xdebug.collect_return=on ;收集变量 xdebug.collect_vars = On xdebug.max_nesting_level=100 xdebug.profiler_enable=on xdebug.profiler_trigger=1 xdebug.profiler_append=1 ;开启远程调试 xdebug.remote_enable=on ;允许连接的zend studio的IP地址 xdebug.remote_host=localhost ;反向连接zend studio使用的端口 xdebug.remote_port=9999 ;用于zend studio远程调试的应用层通信协议 xdebug.remote_handler=dbgp ;如果设得太小,函数中有递归调用自身次数太多时会报超过最大嵌套数错 xdebugbug.max_nesting_level = 10000 xdebug.trace_output_dir="E:/wnmp/tmp/trace" xdebug.profiler_output_dir="E:/wnmp/tmp/profiler"
- 运行phpinfo(),查看页面显示xdebug内容,出现则安装成功
- 打开zend studio。找到window->preferences->php->debug
- 将php debugger选择为XDebug
-
- 点击"PHP Debugger" 右边的“Configure...”,查看xdebug的端口号和php.ini中设置的端口号一致。
- 双击xdebug的端口号,会有弹出层,将“Accept remote session(JIT)”设置为“localhost”
-
到现在,所有的设置都已经OK 了。感激体验吧,附图一张