martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

Ajax call doesn't trigger breakpoint #65

Closed webpolis closed 10 years ago

webpolis commented 10 years ago

I have successfully configured sublime and xdebug, as "break_on_start" will trigger the proper call in sublime.

But, when from my app (Laravel PHP) i make an ajax call like: "http://pe.localhost/projects", and I have a breakpoint in ProjectsController.php where that particular URL/action is defined, the breakpoint is never triggered. The HTTP request is sending the proper param name as cookie:

XDEBUG_SESSION: sublime.xdebug

My custom sublime settings are:

"settings": { "xdebug": { "url": "http://pe.localhost", "super_globals": true, "close_on_stop": true } }

I'm debugging in my localhost (alias pe.localhost).

Any help will be very appreciated. Thanks. Nicolas

martomo commented 10 years ago

Which version of Xdebug extension do you have installed? Did you try using a browser extension to initialize a debugging session through cookies?

What about if you add the XDEBUG_SESSION_START query parameter to you AJAX request? http://pe.localhost/project?XDEBUG_SESSION_START=sublime.xdebug

martomo commented 10 years ago

@webpolis Did you manage to resolve your issue, or are you still having problems?

webpolis commented 10 years ago

Yes. Don't ask me how, it was magically :)

Thanks btw.

tomjegan commented 9 years ago

@webpolis possibly the worst thing you want to read on a thread where you are having similar issues.

I can't get AJAX calls to trigger Xdebug either!

juanmiguel431 commented 8 years ago

Thanks @martomo.

It worked for me your suggestion. I added the XDEBUG_SESSION_START to the parameter request and works. :)

    conexion.open('POST', 'c9-1.php', true);
    conexion.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    var parametes = "pais="+encodeURIComponent(pais.value)+"XDEBUG_SESSION_START="+encodeURIComponent("sublime.xdebug");
    conexion.send(parametes);