Search code examples
phpxdebugxdebug-3

Disable Xdebug 3 "Could not connect" message in CLI


When working with Xdebug 3 in CLI, it constantly reports the message when there are no breakpoints set:

"Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port) :-("

Is there a way to disable that message form showing in CLI?


Solution

  • Unfortunately, the only way to disable this error is to disable generally ALL errors & warnings in xdebug.ini:

    xdebug.log_level = 0
    

    Hopefully there are other ways in future xdebug versions (imho this should only be a weak warning).

    EDIT: As LazyOne mentioned, it's also possible to set an value for error_log in php.ini, for example /var/log/php_error.log. With that change, the log entries are written to this file and not sent to stderr.