xdebug,sublime-text-2和KindariSublimeXdebug

时间:2012-08-02 14:13:32

标签: php linux xdebug sublimetext2

我从未使用过Xdebug,但我想开始。我正在使用Ubuntu Linux并且已经能够:

  • 安装php5-xdebug并确保它正在工作
      通过phpinfo()var_dump()
  • 通过Sublime的软件包管理器安装插件   我可以通过 SHIFT + F8 设置Xdebug网址
  • 来访问插件的菜单 在崇高的设置中
  • "settings": {
        "xdebug": { "url": "http://your.web.server" }
    }
    

这是出了什么问题:

  • 我可以在代码中放置断点,但图标似乎错了, 它只是一个橙色的斑点
  • 当我“开始调试”时,调试窗口显示为完全空白
  • 当我访问我的脚本时,它不会停在我的断点处。

我做错了什么?

5 个答案:

答案 0 :(得分:5)

这些是整个步骤,为我工作

sudo -i
apt-get install php5-xdebug
vim /etc/php5/conf.d/xdebug.ini
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
:wq
apachectl restart
exit
Download do SublimeXdebug
unzip
move folder para ~/.config/sublime-text-2/Packages/Xdebug
Download python 2.6 (careful with i386 vs amd64)
dpkg-deb -x python2.6_2xxxx.deb python2.6
move folder to ~/sublime/lib/python2.6
open google chrome
chrome://settings/extensions
Get more extensions
search for xdebug
install xdebug helper
go to "options" of xdebug helper
in IDE type "other" and in input "sublime.xdebug"
start sublime
open file test.php
add breakpoints
start debugging
in chrome go to http://localhost/test.php
activate the icon of the plugin
refresh

就是这样!

答案 1 :(得分:3)

这是一款来自Jetbrains的非常酷的工具,它是phpStorm的制造商:

http://www.jetbrains.com/phpstorm/marklets/index.html

基本上,只需输入你的xdebug的IDE键(或zend调试器,如果这是你的东西)IDE,它将创建bookmarklet来连接和启用各种功能。

对于sublime text 2,IDE键为:

sublime.xdebug

使用书签时,您无需在任何一端输入任何服务器信息。只要你已经离开默认设置,只需在每个上启动“调试器”,一切都应该自行完成。

您仍然需要在服务器上启用xdebug。

答案 2 :(得分:0)

您可以启用xdebug日志来调试xdebug。

答案 3 :(得分:0)

我遇到了类似的问题(我在Windows 7上运行),对我来说有用的只是确保我将Sublime Text 2作为Windows管理员运行。我相信这是有道理的,因为xDebug是系统的第三方dll。

作为超级用户运行sublime(使用SUDO)可能对你的情况有所帮助。

希望这可以解决您的问题。

答案 4 :(得分:0)

您的sublime是否也无法保存项目设置,例如最近的项目列表?

我有同样的问题,你可以在这里看到:

https://github.com/Kindari/SublimeXdebug/issues/69

解决方案是删除/移动〜/ .config / sublime-text-2文件夹,然后以新的sublime重新开始。之后,断点看起来正常,我的调试器将连接:)