When I am running my lando site in local dev, it is painfully slow. I believe this is because lando uses the XDEBUG_SESSION cookie on every single request, even requests that have nothing to do with what i am debugging. I have the xdebug chrome extension installed but its disabled. Is there a way I can prevent Lando from making this cookie so I can use the chrome extension to choose what requests I want Xdebug to run for?
Asked
Active
Viewed 486 times
1 Answers
1
The better approach is to switch xdebug on/off on demand. When xdebug is on, PHP processing is about 5 times slower beside PHP without active xdebug.
The origin of this solution is https://github.com/lando/lando/issues/1668#issuecomment-507191275 and I can confirm it works.
You can use this tooling in .lando.yml
file to switch xdebug on/off (this example is for Apache, tooling for nginx you can see on the link above):
tooling:
xdebug-on:
service: appserver
description: Enable xdebug for apache.
cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload"
user: root
xdebug-off:
service: appserver
description: Disable xdebug for apache.
cmd: "rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload"
user: root

Martin Klíma
- 56
- 5