Daniel Hollands Daniel Hollands - 1 year ago 673
reST (reStructuredText) Question

XDebug and RESTful server using PHPStorm or POSTman

How can I get a REST client (such as the one built into PHPStorm or POSTman) to work with XDebug?

In my current set-up of XDebug, using PHPStorm and the Bookmarklet provided I'm able to get it working in both Chrome and Firefox - but as soon as I try with POSTman or any other REST client, I can't figure out how to get it started.


Answer Source

Until http://youtrack.jetbrains.com/issue/WI-17031 will be implemented you can try one of these approaches:

  1. Configure your xdebug (by editing php.ini) to attempt to debug every php script (xdebug.remote_autostart = 1)

  2. Add xdebug session start parameter to the actual URL (XDEBUG_SESSION_START={{KEY}} -- http://xdebug.org/docs/remote ), for example: ?XDEBUG_SESSION_START=PHPSTORM

  3. Pass xdebug cookie as one of the headers (the one which is set by bookmarklet or browser extension, for example)

For this to work -- make sure that "phone handle" icon is activated (Run | Start Listen for PHP Debug Connection) in advance.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download