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

1
  • what did you do , what solution did you applied? Commented Aug 8, 2022 at 20:39

3 Answers 3

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.

2
  • what routes are you talking about here, how to change it? Commented Aug 8, 2022 at 20:36
  • @IZANOVA Sorry, my english is not very good. I mean to change the path to your files (php.ini and php_error.log) according to your configuration, in my case was the ones I put in this answer. Commented Nov 15, 2022 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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