# Better WordPress Debugging with Acorn

WordPress has a debug mode, `WP_DEBUG`, that is enabled by setting the `WP_DEBUG` constant in your configuration file. `WP_DEBUG` should always be enabled in your local development environments in order to quickly catch notices and errors.

For folks using Bedrock, the [modern WordPress boilerplate with Composer](https://roots.io/bedrock/), `WP_DEBUG` is already [enabled by default on development environments](https://github.com/roots/bedrock/blob/d28b23116d61bcfa1842d6328587addc78a3c835/config/environments/development.php#L10-L11).

## WP_DEBUG default output

The default `WP_DEBUG` output isn't great: it simply shows the error messages and notices directly on the screen. This is absolutely better than nothing, and if you are developing WordPress plugins and themes, you should **always** enable `WP_DEBUG` mode. The WordPress ecosystem is littered with countless plugins and themes that emit notices and errors.

![Screenshot of the default WP_DEBUG output](/app/uploads/wp_debug-default.png)## Acorn WP_DEBUG outputs

### Acorn's WP_DEBUG default

Acorn will enhance your `WP_DEBUG` output when `WP_DEBUG && WP_DEBUG_DISPLAY` are enabled. By default, Acorn utilizes the Symfony exception handler. This provides an easier to read exceptions thrown on your sites.

![Screenshot of Acorn's default WP_DEBUG output](/app/uploads/wp_debug-acorn-symfony.png)### Acorn's WP_DEBUG output with Ignition

If you're a Laravel developer, you might be familiar with Ignition — the default error page for Laravel since Laravel v9. With the release of Acorn v3, Acorn now includes support for routing in Laravel, which also means that Ignition is now supported on WordPress sites using Acorn. We recommend installing Ignition on your sites for the best [error handling experience in WordPress](https://roots.io/acorn/docs/error-handling/#ignition).

![Screenshot of Acorn's WP_DEBUG output with Ignition](/app/uploads/wp_debug-acorn-ignition.png)To start using Ignition with WordPress, run `composer require spatie/laravel-ignition --dev` from the same directory that Acorn's installed.

### Acorn's WP_DEBUG output with whoops

Prior to Acorn v3, we recommended installing [whoops](https://github.com/filp/whoops) alongside Acorn. For folks still on Acorn v2, we do recommend [upgrading to Acorn v3](https://roots.io/acorn/docs/upgrading-acorn/), but it's still possible to have a better experience compared to the Symfony error page by installing whoops:

![Screenshot of Acorn's WP_DEBUG output with whoops](/app/uploads/wp_debug-acorn-whoops.png)## Non-Acorn alternatives

If you're not developing a site with Acorn (which you should be — don't you want to use things like [Laravel helpers](https://laravel.com/docs/9.x/helpers) in your codebase for a more modern PHP vibe?)— there's also some WordPress plugins that provide a better `WP_DEBUG` experience besides the default:

- [Query Monitor](https://querymonitor.com/) (a must-have for any local WordPress environment)
- [Debug Bar](https://wordpress.org/plugins/debug-bar/)