Using Xdebug

Philip Newcomer edited this page Aug 30, 2017 · 7 revisions

Configure your IDE with the IDE key pilothouse. Make sure path mappings are configured in your IDE to map the site's path on the host to the path in the Docker container, which is /var/www/html/sites/{sitename}/.

Xdebug is not enabled on requests by default, for performance reasons. However, you can easily toggle Xdebug on for a specific domain by setting a cookie named xdebug with a value of on in your browser. Whenever this cookie is present in the request, Xdebug will be enabled.

There is now an experimental Chrome Extension which provides a button for quickly toggling the Xdebug status: https://github.com/Pilothouse-App/pilothouse-chrome-extensions

The following bookmarklets can be added to your favorites bar to quickly add and remove the Xdebug cookie:

Toggle Xdebug On

javascript:(function(){document.cookie='xdebug=on;path=/;';})()

Toggle Xdebug Off

javascript:(function(){document.cookie='xdebug=;path=/;';})()

Using query parameters. Simply append this to your URL and xDebug will be used:

?xdebug=on

To run a WP-CLI command with Xdebug enabled, add the --xdebug flag to your command:

wp command-to-run --xdebug