Xdebug extends PHP with step debugging, richer errors, tracing, profiling, and code coverage for IDEs and PHPUnit.
Overview
Xdebug is a debugging and diagnostics extension for PHP. It plugs into a PHP runtime to improve day-to-day development with controlled breakpoints, richer error output, and optional deep visibility into how scripts execute.
Step debugging lets you pause and advance through code from an IDE or editor while the script runs; each feature is enabled through explicit configuration settings. Improved reporting augments notices, warnings, errors, and exceptions with stack traces and a stronger var_dump-style dump. Tracing can log function calls, arguments, assignments, and return values to disk. Profiling supports performance analysis with external visualization tools, and coverage mode highlights executed lines during PHPUnit runs.
Installation is available through common Linux distribution packages, or via the PIE installer on Linux, macOS, and Windows when a supported PHP build is present. Documentation on xdebug.org lists per-feature setup and the full settings reference.
PHP developers who need IDE-backed debugging or measurable insight into runtime behavior adopt Xdebug as a standard companion to their stack.
Key features
- IDE step debugging
- Enhanced PHP error reporting
- Execution tracing to disk
- Request profiling output
- PHPUnit code coverage
- Configurable feature modes
- Distribution packages and PIE install
Use cases
- Debugging PHP in an IDE
- Profiling slow web requests
- Recording function-level traces
- Measuring unit test coverage