Skip to main content

Debugging

Step-debugging with XDebug​

Install the XDebug PHP extension on your host (php -v should mention with Xdebug), then restart the webserver with it on or off:

make debug # Restart with XDebug enabled
make start # Restart without XDebug

debug is also available as debug-on, xdebug and xdebug-on, and start as debug-off and xdebug-off. debug checks the command line of the running server and skips the restart when XDebug is already on. With XDebug on, every request starts a debug session, because the server runs with xdebug.mode=debug and xdebug.start_with_request=yes.

When the extension isn't installed, start with XDEBUG=1 stops with a message rather than starting a server without it.

Code coverage stays on pcov, because the XDebug settings apply only to the webserver, not to the test commands.

To start and stop debug sessions from the browser, install the Xdebug Helper extension for Chrome or Firefox.

Command output​

The commands print only their own progress, such as [TASK] and [ OK ] lines, and hide the output of the tools they run, such as Composer, npm and Drush. When a tool fails, its captured output appears, so the failure is still there to read. The output of your project's own commands, npm run build and the lifecycle scripts, always shows.

Set DEBUG=1 to stream the full output of every tool as it runs:

DEBUG=1 make build

Logs​

The processes that keep running after a command returns write their output to the project's .logs directory:

FileWritten by
.logs/php.logThe PHP webserver.
.logs/chromedriver.logThe chromedriver that FunctionalJavascript tests drive.
.logs/cloudflared.logThe public tunnel.

Functional and FunctionalJavascript tests write their HTML pages and screenshots to .logs/browser_output (see Testing). reset removes the whole .logs directory.