Magento 2 · Debugging
Xdebug + PHPStorm
the optimal debug workflow
A good debug setup in Magento 2 doesn't save minutes, it often saves whole days. If you set up Xdebug and PHPStorm cleanly for browser, CLI and Docker, you understand error paths faster and lose far less time to wrong assumptions.
20 min read
Xdebug
Magento 2.4.8
Table of contents
- 1. Why Xdebug PHPStorm Magento 2 is more than just a setup topic
- 2. Enabling Xdebug cleanly in Docker and Mark Shust environments
- 3. Configuring PHPStorm correctly
- 4. Reliably hitting browser requests, cookies and breakpoints
- 5. CLI debugging for setup, cron and indexers
- 6. An efficient debug workflow for Magento 2
- 7. Typical sources of error
- 8. var_dump vs. Xdebug vs. logs
- 9. Magento 2 support
- 10. Summary and FAQ
1. Why Xdebug PHPStorm Magento 2 is more than just a setup topic
Xdebug PHPStorm Magento 2 looks, at first glance, like a purely technical setup detail. In practice, though, this setup decides