Starting debug without XDEBUG_SESSION_START at the of query

13,344

Solution 1

I don't know the exact behavior of your IDE (PHPStrom), but in my experience, after you hit run and launch a browser with the XDEBUG_SESSION_START addition to the url, you can just change the url in the browser and remove the XDEBUG_SESSION_START part. The debugger will still be active and breakpoints will hit.

Solution 2

I tried. And it's possible.

You can use the browser extensions:


Or by using the settings in the php.ini file. Add the xdebug.remote_enable=true and xdebug.remote_autostart=true into your php.ini and restart your web server.

Something like this:

[xdebug]
zend_extension="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_autostart=true
Share:
13,344
Zed
Author by

Zed

Updated on June 30, 2022

Comments

  • Zed
    Zed almost 2 years

    I created basic PHP Web Application Launch configuration in PHPStrom, that uses Xdebug. However after hitting run, query parameter XDEBUG_SESSION_START is added to the end of URL, and because of the nature of my application this causes some errors inside the app. So, is there a way to stop adding that parameter at the end of URL, or maybe adding that parameter as the first query parameter in URL ?

  • Zed
    Zed over 9 years
    That's true, but I was looking for a solution where I wouldn't do that, because I'm lazy :)
  • nl-x
    nl-x over 9 years
    Well, what I haven't tried is removing the XDEBUG_SESSION_START addition completely. In my IDE (NetBeans) this is possible in the options->debugger. Surely this is possible in PHPStrom as well. But I don't know if doing this will still have the debugger ready to catch breakpoints. You'll have to find out yourself.
  • Zed
    Zed over 9 years
    Unfortunately, I haven't found this option in PHPStorm debug settings, I guess I'll have to live with that, thank you anyway.
  • LazyOne
    LazyOne over 9 years
    PhpStorm has "Run" and "Debug" actions available. If OP wants to initiate debug session from within an IDE, then such "flag" has to be passed somehow, right? And GET/POST parameter is the most obvious (and only available) option (otherwise you have to use "Run" instead of "Debug" initiate it from outside, which gives you more control but requires extra moves).
  • nl-x
    nl-x over 9 years
    The manual shows where to find the Xdebug settings: jetbrains.com/phpstorm/webhelp/configuring-xdebug.html . Look under Integrating XDebug with PhpStorm. I'm not sure you will find it though, as I don't use PHPStrom
  • nl-x
    nl-x about 9 years
    @Zed you never said if you could find it in the options.