Question

I am running a symfony2 webapp, and Im trying to use XDebug with Sublime Text 3, using this package but I am running with the problem that I need to manually write XDEBUG_SESSION_START in the URL for it to work. Is there a way that Symfony could add this automatically, so I dont lose it in page transitions?

php.ini

[xdebug]
zend_extension = "c:\Program Files (x86)\PHP5\ext\php_xdebug-2.2.2-5.3-vc9.dll"
xdebug.remote_enable = 1
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.profiler_enable = 1;
Was it helpful?

Solution

Yep, set it as a cookie. Here you can generate bookmarklets for setting / deleting the cookie: http://www.jetbrains.com/phpstorm/marklets/

HTTP Debug Sessions

Xdebug contains functionality to keep track of a debug session when started through a browser: cookies. This works like this:

When the URL variable XDEBUG_SESSION_START=name is appended to an URL Xdebug emits a cookie with the name "XDEBUG_SESSION" and as value the value of the XDEBUG_SESSION_START URL parameter. The expiry of the cookie is one hour. The DBGp protocol also passes this same value to the init packet when connecting to the debugclient in the "idekey" attribute.

When there is a GET (or POST) variable XDEBUG_SESSION_START or the XDEBUG_SESSION cookie is set, Xdebug will try to connect to a debugclient.

To stop a debug session (and to destroy the cookie) simply add the URL parameter XDEBUG_SESSION_STOP. Xdebug will then no longer try to make a connection to the debugclient.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top