Xdebug is a PHP extension that greatly simplifies the debugging process. Once installed and enabled, Xdebug generates easier to read error messages that include a backtrace. Xdebug also allows you to step through the life cycle of a Drupal page request in incredibly useful ways.
- Improve the formatting of error messages output to the browser
- Connect an IDE to allow setting breakpoints and inspecting the request lifecycle
- Enable and examine an application profile to find inefficiencies
Xdebug is a PHP Extension. Generally speaking, it is installed and configured once per server. Once you set it up on your local development server you likely won't have to make any configuration changes at all.
- Debugging in PhpStorm
- This video was created by the folks behind PhpStorm. It contains an extremely fast-paced example of the setup and use of Xdebug using the PhpStorm IDE. PhpStorm isn't required to use Xdebug.
- PHP Applications Profiling in PhpStorm
- This video demonstrates how Xdebug enables profiling of PHP applications. Again, PhpStorm isn't required to use this Xdebug functionality but it does contain some useful tools to make the process a bit easier.
- Debug Drupal Code topic
- While Xdebug is one particular tool that's useful in debugging, there are other techniques you can use to debug your Drupal site. Several of those are covered here.
- Development Environments topic
- Many solutions for setting up a local development environment come with Xdebug already enabled and configured, making it even easier to get started using it.