Xdebug: [Step Debug] Could not connect to debugging client - flooding logs

Hey @swinggraphics – You’re right that this is still an issue. The Local team has been focused on other work lately, so this hasn’t been worked on. For some of your specific questions:

Do these thousands of messages mean that there are thousands of bugs that are not getting logged properly?

Not really. This is only an Xdebug message, which is a tool for development.

How can I just get the normal debug.log like WordPress creates by default when WP_DEBUG is enabled?

If you are not using things like the step debugger, then you can safely turn Xdebug off by clicking the toggle on the site overview page.

setting xdebug.log and updating xdebug.log_level on the Site level php.ini.hbs and php.ini within Application Support dir does not respect the changes. I have Version 9.0.2+6676

I can confirm that the added line in php.ini.hbs file does work, with the following additional step:
You just need to Stop and restart the site in Local.
After that, only your debug code should appear and all the Xdebug errors should be a thing of the past.
This was the exact error in my case:
“Xdebug: [Step Debug] Could not connect to debugging client. Tried: ::1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(”

To confirm:
Add the line “xdebug.log_level=0” in this snippet:

{{#if xdebugEnabled}}
xdebug.mode=debug,develop
xdebug.log_level=0
{{else}}
xdebug.mode=off
{{/if}}
xdebug.client_port=9003
xdebug.start_with_request=yes
xdebug.discover_client_host=yes

The location(s) of the file was provided in a screenshot by @jb510 above.
This is accurate even for Mac installations.
To summarize the location: [Your Local site’s installation folder] → [conf] → [php (and/or the site’s current php version folder] → php.ini.hbs
The snippet is located near the end of the file.

The intial code suggestion was made @afragen above.
He rightly mentions the following important notices:

  1. It may have to be redone after every new update of LocalWP
  2. log_level=7 is for debugging XDebug itself, which most of us would never really need. log_level=0 reduces that to only log php, what most of us is after.
3 Likes