2

I've installed Xdebug on my Vagrant server and the XdebugClient plugin for Sublime Text 3. When I start debugging, my page loads in the browser but nothing shows up in the context, watch or stack tabs. The xdebug.log file is also empty. The following are my settings:

php.ini

[CUSTOM]

error_reporting=1
display_errors=true
track_errors=1

[xdebug ]

zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_connect_back=1
xdebug.default_enable=1
xdebug.remote_autostart=0
xdebug.idekey=sublime.xdebug
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.2.15
xdebug.remote_port=9001
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp/profiler"
xdebug.remote_mode=req

xdebug.ini

zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.2.15
xdebug.remote_port=9001
xdebug.remote_log="/var/log/xdebug/xdebug.log"

.sublime_project

"settings": {
        "xdebug": {
            "url": "http://mysite.dev/",
            "path_mapping": {"/vagrant/www/mysite/dist" : "/Users/iii/Documents/Dev/vagrant/www/mysite/dist"},
            "super_globals": true,
            "close_on_stop": true,
        }
    }

Xdebug.sublime-settings

{
    "close_on_stop": true,
    "pretty_output": true,
    "launch_browser": true,
    "debug": true,
    "ide_key": "sublime.xdebug",
    "port": 9001,
}

Can someone please tell me what is wrong here?

1
  • Xdebug log should be created .. as long as xdebug sees the xdebug COOKIE/GET/POST parameter. So .. try with xdebug.remote_autostart=1 -- it will tell xdebug to attempt to debug every single request. If still nothing (not even xdebug log) -- what security software/packages do you have on your virtual machine (e.g. SELinux and alike). Commented Nov 25, 2016 at 10:59

2 Answers 2

1

I was facing a similar problem with Vagrant/Sublime/Xdebug. I found that the latest version of Xdebug (2.6.0) doesn't work well with Sublime. Evidently, there's an XML formatting issue.

I found two things that both solved the problem:

  • Revert to Xdebug 2.5.5, or
  • set "super_globals": false, in your config.

(https://github.com/martomo/SublimeTextXdebug/issues/172)


ETA 24 Oct 2018:

In my case, the solutions above were not necessarily a fix, but just helped to avoid the real issue in some cases. The real fix appears to require a change to the Sublime Package: https://github.com/martomo/SublimeTextXdebug/issues/172#issuecomment-410478057

I ended up forking the SublimeTextXdebug (assuming this is the package you're using), patching it, and then replacing the package with the patched version. (There's a pull request in the main repository, but I don't think it's been pulled yet.)

Sign up to request clarification or add additional context in comments.

Comments

0

Just in case someone else has the same problem. I was using Sublime 2 with Xdebug without any issues. I upgraded to Sublime 3 and was not able to get Xdebug to break. I went through various posts and tried various recommendations without success, until, I added the setting xdebug.remote_log="/var/log/xdebug/xdebug.log". No idea why, but once this was added, it started to work.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.