3

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

  • install php5-xdebug and make sure it is working
    through phpinfo() and var_dump()
  • install the plugin through Sublime's Package Manager
    I can access the plugin's menu through SHIFT+F8 setup the 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
  • 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?

1
  • I actually run into the same exact issue with Xdebug and ST2 and have been unable to find a resolution thus far. Here's hoping someone provides an answer.
    – Valjas
    Aug 20, 2012 at 5:53

5 Answers 5

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!

3
  • What does para and metes mean? Dec 24, 2012 at 19:22
  • sorry, a bit of portuguese i forgot to translate. I edited the answer Dec 26, 2012 at 16:24
  • Hey can we use any version of python2.6 as its not availible easily. may i use idle-python2.6_2.6.8-1.1_all.deb Sep 14, 2017 at 17:26
3

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

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.

For sublime text 2, the IDE key is:

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.

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

0
0

You can enable xdebug log to debug xdebug.

2
  • i enabled it to write to a log file and the file remains empty Aug 3, 2012 at 13:47
  • You can try to connect to xdebug and append the string XDEBUG_SESSION_START to your url.
    – Micromega
    Aug 3, 2012 at 14:25
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.

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

Hopefully this solves your problem.

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

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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.