Sublime配置XDebug

1.安装XDebug扩展

可以进入XDebug官网下载相应版本的xdebug。如果不能够确定需要选择的版本号,可以打印phpinfo,并且右键查看源码并进行复制。

粘贴到http://xdebug.org/wizard.php,既可以查看到推荐的XDebug版本。

下载dll文件,粘贴到php的ext目录下。并修改php.ini,添加如下:

[XDebug]
zend_extension_ts = e:\php\ext\php_xdebug-2.2.3-5.2-vc9.dll
xdebug.profiler_enable=on
xdebug.trace_output_dir="f:\xdebug"
xdebug.profiler_output_dir="f:\xdebug"
xdebug.remote_enable = on
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000

2.Sublime安装xdebug

下载的路径为:https://github.com/martomo/SublimeTextXdebug

下载后的文件夹,放入sublime->preference->browse packages,重启sublime,即可以看到preference->package setting中有xdebug

用ctrl+shift+p调出搜索框,输入xdebug既可以看到xdebug相关的功能


3.firefox安装xdebug

firefox的xdebug扩展为easiest xdebug,路径为:https://addons.mozilla.org/zh-cn/firefox/addon/the-easiest-xdebug/

安装完后,浏览器右下角有个绿色的甲壳虫,点击这个甲壳虫,它有颜色时即为debug状态


4.调试

1.xdebug可以选择watch变量

2.xdebug可以在代码中设置断点

3.xdebug可以start

4.在firefox debug状态下运行,即可以看到断点处的输出;并且可以进行单步调试


快捷键说明如下:

Start/Stop debugging session
  • Start Debugging - Ctrl+Shift+F9 or ⌘+Shift+F9
  • Start Debugging (Launch Browser)
  • Restart Session
  • Stop Debugging - Ctrl+Shift+F10 or ⌘+Shift+F10
  • Stop Debugging (Launch Browser)
  • Stop Debugging (Close Windows)
Breakpoints
  • Add/Remove Breakpoint - Ctrl+F8 or ⌘+F8
  • Set Conditional Breakpoint - Shift+F8
  • Clear Breakpoints
  • Clear All Breakpoints
Watch expressions
  • Set Watch Expression
  • Edit Watch Expression
  • Remove Watch Expression
  • Clear Watch Expressions
Session commands
  • Evaluate
  • Execute
  • Status
Continuation commands
  • Run - Ctrl+Shift+F5 or ⌘+Shift+F5
  • Run To Line
  • Step Over - Ctrl+Shift+F6 or ⌘+Shift+F6
  • Step Into - Ctrl+Shift+F7 or ⌘+Shift+F7
  • Step Out - Ctrl+Shift+F8 or ⌘+Shift+F8
  • Stop
  • Detach
Other
  • Restore Layout / Close Windows - Ctrl+Shift+F11 or ⌘+Shift+F11
  • Settings - Default
  • Settings - User

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值