Christian Engel
Christian Engel

Reputation: 3778

Enable xDebug for a webhook

I know that xDebug can be enabled (if configured so) to be enabled when a certain cookie is sent along.

I have the case now that a PHP script is being called through a remote server (webhook). Is it possible to enable xDebug through a PHP function call that I can place at the beginning of the PHP file to be called by the webhook?

Or is there any other possibility to enable xDebug for that webhook?

Upvotes: 2

Views: 503

Answers (2)

jeff-h
jeff-h

Reputation: 2639

Alternatively, assuming you're running Xdebug 3 (which you most likely will be in 2023), and you have access to the xdebug configuration, you can enable start_with_request.

In my setup (IndigoStack) the file is at conf.d/20-xdebug.ini. You need to add the following line:

xdebug.start_with_request=yes

Read more here: https://xdebug.org/docs/upgrade_guide

Upvotes: 0

Christian Engel
Christian Engel

Reputation: 3778

Okay, figured something out. One can simply append the GET parameter "XDEBUG_SESSION_START" to the URL being called by the webhook to enable xDebug.

Upvotes: 2

Related Questions