0

I'm using Magento 2.4.1, PHP 7.4, and xdebug 3.0.4. The xdebug is working normally with this setting in php.ini:

enter image description here

But whenever I run bin/magento setup:upgrade or any others bin/magento command I always see this even though it is not affecting the function but its annoying:

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

enter image description here

0

Xdebug 3 will warn you if you use xdebug.start_with_request=yes; or xdebug.start_with_request=1

The correct way of fixing not showing an error message is to not instruct Xdebug to make a connection to your IDE.

Use xdebug.start_with_request=trigger and a debugger helper plugin/add-on for browser instead.(Firefox, Chrome: Xdebug helper). Toggle the option while you want to have debug on current request.

0

I think the command below must suppress that message error.

xdebug.log_level = 0
0

The option xdebug.start_with_request = yes tells Xdebug to try to debug every single request/script. If Xdebug fails to connect to the debug client (it takes values from xdebug.client_host and xdebug.client_port) then it notifies you about that.

Normally such a messages will be written to the standard PHP's error log. Looks like you don't have it configured at all in your php.ini (because this is how it comes by default), therefore PHP sends it to your standard output instead.

If you want to prevent it from appearing on you terminal output you have to point the PHP error_log to a valid location.

Example of how I solved it in my case:

1- Edit your ini file:

sudo vi /etc/php/7.4/cli/php.ini

2- And add this line:

error_log = /var/www/log/php_error.log

NOTE: Change the previous routes according to your case.

3- Try again and the warning should disappear and now goes to the log file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.