Development

Faster Debugging with Lando and xdebug

I’ve been struggling with the speed (or lack thereof) of Lando for Drupal sites. I have suspected xdebug was part of the issue. Sure enough, disabling xdebug speeds up the lando instance considerably. Re-enabling it slows it right back down again. I use xdebug often, so having to lando rebuild  to turn xdebug on and off is not an option. I wondered if there’s a way to leave the extension enabled but only use it when needed.

While researching config directives like xdebug.remote_enable  and xdebug.remote_autostart, I came across this issue thread on the github Lando project: Allow faster xdebug on/off toggling

The title sounds promising, right?

Within this thread I found a tip that ought to be in the official Lando documentation. As it turns out, it’s quite simple to turn xdebug on and off at will. And, using Lando tooling commands it’s as easy as lando xdebug-on  or lando xdebug-off. Here’s the post: https://github.com/lando/lando/issues/1668#issuecomment-507191275

 

Sample Lando File

If you’re using Apache instead of Nginx:

 

Leave a Reply

Your email address will not be published.