xdebug,sublime-text-2 KindariSublimeXdebug

时间:2021-11-18 07:33:44

I have never used Xdebug, but i would like to start. I am using Ubuntu Linux and have already been able to:

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

  • install php5-xdebug and make sure it is working
    through phpinfo() and var_dump()
  • 安装php5-xdebug并确保它通过phpinfo()和var_dump()工作
  • install the plugin through Sublime's Package Manager
    I can access the plugin's menu through SHIFT+F8 setup the Xdebug url
  • 通过Sublime的Package Manager安装插件我可以通过SHIFT+F8设置Xdebug url来访问插件的菜单
  • in sublime settings:

    在崇高的设置:

    "settings": {
        "xdebug": { "url": "http://your.web.server" }
    }
    

Here's what is going wrong:

这就是问题所在:

  • I can place breakpoints in the code, but the icon seems to be wrong, it's just an orange blob
  • 我可以在代码中放置断点,但是图标似乎是错误的,它只是一个橙色的blob
  • When I "start debugging" the debug window appears completely empty
  • 当我“开始调试”时,调试窗口显示为完全空的
  • when I access my script, it doesn't stop at my break points.
  • 当我访问脚本时,它不会在断点处停止。

What am I doing wrong?

我做错了什么?

5 个解决方案

#1


5  

these are the whole steps, worked for me

这些都是我工作的全部步骤

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

That is it!

这就是它!

#2


3  

Here is a very cool tool from Jetbrains, the makers of phpStorm:

这是来自Jetbrains公司的一个非常酷的工具,phpStorm的制造者:

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

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

Basically, just enter in the IDE key for your xdebug (or zend debugger if that's your thing) IDE and it will create bookmarklets to connect and enable the various functions.

基本上,只需输入您的xdebug(或者zend debugger,如果您喜欢的话)IDE的IDE键,它就会创建bookmarklet来连接和启用各种功能。

For sublime text 2, the IDE key is:

对于崇高的文本2,IDE关键字是:

sublime.xdebug

sublime.xdebug

When you use the bookmarklets, you don't need enter in any server information on either end. Just "Start Debugger" on each and everything should work itself out, as long as you've left the default settings.

使用bookmarklet时,不需要在任何一端输入任何服务器信息。只要你保留了默认设置,每一个都要“启动调试器”。

You still need to enable xdebug on your server of course.

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

#3


0  

You can enable xdebug log to debug xdebug.

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

#4


0  

I had a similar problem (I am running on Windows 7 though) and what worked for me was just making sure that I ran Sublime Text 2 as a Windows administrator. I believe this makes sense, since xDebug is a third-party dll to the system.

我也遇到过类似的问题(虽然我在Windows 7上运行),对我有用的只是确保我作为Windows管理员运行了出色的Text 2。我相信这是有意义的,因为xDebug是系统的第三方dll。

Maybe running sublime as a super user (using SUDO) might help in your case.

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

Hopefully this solves your problem.

希望这能解决你的问题。

#5


0  

Does your sublime also fail to save project settings, like the recent project list?

您的崇高是否也未能保存项目设置,比如最近的项目列表?

I had the same issue, you can see it here:

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

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

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

The solution was to delete / move the ~/.config/sublime-text-2 folder then start again with a fresh sublime. After that, breakpoints looked normal and my debugger would connect :)

解决方案是删除/移动~/。配置/ sublimetext -2文件夹然后重新开始一个新的崇高。之后,断点看起来是正常的,我的调试器将连接:)

#1


5  

these are the whole steps, worked for me

这些都是我工作的全部步骤

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

That is it!

这就是它!

#2


3  

Here is a very cool tool from Jetbrains, the makers of phpStorm:

这是来自Jetbrains公司的一个非常酷的工具,phpStorm的制造者:

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

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

Basically, just enter in the IDE key for your xdebug (or zend debugger if that's your thing) IDE and it will create bookmarklets to connect and enable the various functions.

基本上,只需输入您的xdebug(或者zend debugger,如果您喜欢的话)IDE的IDE键,它就会创建bookmarklet来连接和启用各种功能。

For sublime text 2, the IDE key is:

对于崇高的文本2,IDE关键字是:

sublime.xdebug

sublime.xdebug

When you use the bookmarklets, you don't need enter in any server information on either end. Just "Start Debugger" on each and everything should work itself out, as long as you've left the default settings.

使用bookmarklet时,不需要在任何一端输入任何服务器信息。只要你保留了默认设置,每一个都要“启动调试器”。

You still need to enable xdebug on your server of course.

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

#3


0  

You can enable xdebug log to debug xdebug.

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

#4


0  

I had a similar problem (I am running on Windows 7 though) and what worked for me was just making sure that I ran Sublime Text 2 as a Windows administrator. I believe this makes sense, since xDebug is a third-party dll to the system.

我也遇到过类似的问题(虽然我在Windows 7上运行),对我有用的只是确保我作为Windows管理员运行了出色的Text 2。我相信这是有意义的,因为xDebug是系统的第三方dll。

Maybe running sublime as a super user (using SUDO) might help in your case.

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

Hopefully this solves your problem.

希望这能解决你的问题。

#5


0  

Does your sublime also fail to save project settings, like the recent project list?

您的崇高是否也未能保存项目设置,比如最近的项目列表?

I had the same issue, you can see it here:

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

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

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

The solution was to delete / move the ~/.config/sublime-text-2 folder then start again with a fresh sublime. After that, breakpoints looked normal and my debugger would connect :)

解决方案是删除/移动~/。配置/ sublimetext -2文件夹然后重新开始一个新的崇高。之后,断点看起来是正常的,我的调试器将连接:)