Video Lesson: Enable, disable, and check the status of Xdebug in Docker

Enable, disable, and check the status of Xdebug in Docker

Learn how to control and check a debugging tool's active mode to balance debugging capabilities with application performance.


Lesson Content

To debug with Xdebug, the Xdebug PHP extension must be installed and enabled on the web server. docker-magento installs and enables the extension automatically.

Since Xdebug 3, the extension remains enabled inside the container, but its mode is set to off by default. Keeping the extension installed and enabled has no performance impact. The performance impact comes from setting the Xdebug mode to debug, so you only enable that mode while actively debugging.

To check the current Xdebug status, run:

bin/xdebug status

The output shows whether debug mode is enabled. To enable debug mode, run:

bin/xdebug enable

This enables Xdebug in the container and restarts the container automatically. Check the status again to confirm that debug mode is enabled:

bin/xdebug status

When you finish debugging, disable debug mode again:

bin/xdebug disable

This sets the Xdebug mode back to off. Check the status whenever you need to confirm the current mode:

bin/xdebug status

Keep Xdebug off during normal development and enable it only when you are actively debugging with Xdebug.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Log in for AI tutor access.

Comments

Join the discussion!

Notes

Keep track of what you learn!