This commit _Adds xdebug.remote_autostart to simplify xdebug sessions_: ac336ee512
This commit slows down the dev environment significantly:
The only time setting this to 1 is a good idea is when there is no other way to send the XDebug session start command (for example, when debugging an application that receives HTTP calls from a 3rd party machine).
I use the Xdebug plugin. I've been clicking "Debug" and things have been working fine for a about a year until now. There are similar plugins for other browsers. I would prefer this setting off by default.
Thank you for your consideration.
@nathanielks have you run into this?
Apologies for the late reply, I've been having email issues. I can't say I've observed this, though I've only tested on vanilla WordPress installs. @connerbw do you have any tests to show remote autostart is indeed causing the issue? As I understand it, Remote Autostart will attempt a connection to the debugging server, and if the connection fails, move on with the request.
In the meantime, you can set it to 0 here: https://github.com/roots/trellis/blob/master/group_vars/development/php.yml#L10
Even with that said, I don't think it'd hurt to have xdebug disabled by default and manually opt in. What do you think @swalkinshaw?
I think disabling by default is probably better since I assume most people don't use it?
We'll disable it by default, @connerbw. Just remember to add the following back whenever you want to debug:
xdebug_remote_enable: 1
xdebug_remote_connect_back: 1
If you don't want to use remote connect back, you could change the remote host to the host-only network root ip. If you're using default trellis where the Vagrant machine's ip is 192.168.50.5, the root ip would be 192.168.50.1. If you're using a different ip, change the final value to 1 and it'll point to the host machine.
xdebug_remote_host: 192.168.50.1
# or for example, if the ip is 10.0.0.5
xdebug_remote_host: 10.0.0.1
Thanks @nathanielks
do you have any tests to show remote autostart is indeed causing the issue
Here's a page, reloaded 10 times to make sure caching is primed and yada yada, with xdebug.remote_autostart = 0
TTFB: ~350 ms
Same page, same server, same conditions, only config change is xdebug.remote_autostart = 1
TTFB: ~1090 ms
Best regards,
@nathanielks @swalkinshaw
Just remember to add the following back whenever you want to debug:
Uhh OK?
This ticket was only supposed to be about: xdebug_remote_autostart: 1
xdebug_remote_enable: 1 and xdebug_remote_connect_back: 1 were fine.
See previous comment.
Oh well.
fwiw we reverted removing those two parameters. Thanks for bringing this to our attention!
Most helpful comment
Fixed in https://github.com/roots/trellis/pull/1008