PHPStorm doesn't listen to incoming connections
Hi there,
PHPStorm doesn't listen to incoming connections. Firstly my configuration:
I've installed Xdebug to my local webserver (on macOS), "php -v" returns
----------------------------------------------
PHP 7.2.12 (cli) (built: Nov 9 2018 11:00:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
with Zend OPcache v7.2.12, Copyright (c) 1999-2018, by Zend Technologies
----------------------------------------------
By activating the Chrome extension, Xdebug writes correctly in the logs:
----------------------------------------------

Validating Debugger Configuration returns:

By starting this configuration nothing happens (while I'm requesting "designpatterns.sn" and log files are written):

... and finally my phpinfo:
| xdebug support | enabled |
|---|---|
| Version | 2.6.1 |
| IDE Key | PHPSTORM |
| Supported protocols |
|---|
| DBGp - Common DeBuGger Protocol |
| Directive | Local Value | Master Value |
|---|---|---|
| xdebug.auto_trace | Off | Off |
| xdebug.cli_color | 0 | 0 |
| xdebug.collect_assignments | Off | Off |
| xdebug.collect_includes | On | On |
| xdebug.collect_params | 0 | 0 |
| xdebug.collect_return | Off | Off |
| xdebug.collect_vars | Off | Off |
| xdebug.coverage_enable | On | On |
| xdebug.default_enable | On | On |
| xdebug.dump.COOKIE | no value | no value |
| xdebug.dump.ENV | no value | no value |
| xdebug.dump.FILES | no value | no value |
| xdebug.dump.GET | no value | no value |
| xdebug.dump.POST | no value | no value |
| xdebug.dump.REQUEST | no value | no value |
| xdebug.dump.SERVER | no value | no value |
| xdebug.dump.SESSION | no value | no value |
| xdebug.dump_globals | On | On |
| xdebug.dump_once | On | On |
| xdebug.dump_undefined | Off | Off |
| xdebug.extended_info | On | On |
| xdebug.file_link_format | no value | no value |
| xdebug.filename_format | no value | no value |
| xdebug.force_display_errors | Off | Off |
| xdebug.force_error_reporting | 0 | 0 |
| xdebug.gc_stats_enable | Off | Off |
| xdebug.gc_stats_output_dir | /var/tmp/ | /var/tmp/ |
| xdebug.gc_stats_output_name | gcstats.%p | gcstats.%p |
| xdebug.halt_level | 0 | 0 |
| xdebug.idekey | PHPSTORM | PHPSTORM |
| xdebug.max_nesting_level | 256 | 256 |
| xdebug.max_stack_frames | -1 | -1 |
| xdebug.overload_var_dump | 2 | 2 |
| xdebug.profiler_aggregate | Off | Off |
| xdebug.profiler_append | Off | Off |
| xdebug.profiler_enable | Off | Off |
| xdebug.profiler_enable_trigger | On | On |
| xdebug.profiler_enable_trigger_value | no value | no value |
| xdebug.profiler_output_dir | /var/tmp/ | /var/tmp/ |
| xdebug.profiler_output_name | cachegrind.out.%p | cachegrind.out.%p |
| xdebug.remote_addr_header | no value | no value |
| xdebug.remote_autostart | Off | Off |
| xdebug.remote_connect_back | Off | Off |
| xdebug.remote_cookie_expire_time | 3600 | 3600 |
| xdebug.remote_enable | On | On |
| xdebug.remote_handler | dbgp | dbgp |
| xdebug.remote_host | 127.0.0.1 | 127.0.0.1 |
| xdebug.remote_log | /tmp/xdebug.log | /tmp/xdebug.log |
| xdebug.remote_mode | req | req |
| xdebug.remote_port | 9000 | 9000 |
| xdebug.remote_timeout | 200 | 200 |
| xdebug.scream | Off | Off |
| xdebug.show_error_trace | Off | Off |
| xdebug.show_exception_trace | Off | Off |
| xdebug.show_local_vars | Off | Off |
| xdebug.show_mem_delta | Off | Off |
| xdebug.trace_enable_trigger | Off | Off |
| xdebug.trace_enable_trigger_value | no value | no value |
| xdebug.trace_format | 0 | 0 |
| xdebug.trace_options | 0 | 0 |
| xdebug.trace_output_dir | /var/tmp/ | /var/tmp/ |
| xdebug.trace_output_name | trace.%c | trace.%c |
| xdebug.var_display_max_children | 128 | 128 |
| xdebug.var_display_max_data | 512 | 512 |
| xdebug.var_display_max_depth | 3 | 3 |
Does anybody knows why it doesn't work? I've read many articles but no solution worked.
Please sign in to leave a comment.
Hi there,
Please change Xdebug port to 9001 or some another number (don't forget to restart webserver, if you have one).
Right now it looks like standard 9000 might be already occupied by php-fpm (most often reason on Mac/Linux) -- Xdebug logs clearly shows that it connects somewhere ... and gets "go away" kind of answer.
Use "sudo lsof -nP -iTCP -sTCP:LISTEN" to see what service listens on TCP 9000 port instead of PhpStorm.
Your solution worked. Thank you!
For me, the solution was to downgrade PhpStorm from 2020.3 to 2020.2. I did this using JetBrains Toolbox App.
For some reason, Xdebug stopped suddenly working despite valid configuration. I tried changing ports with no success and many many different approaches, including restarting IDE, Docker and even computer.
I thought the reason is combination of Windows, Docker, WSL 2 and Xdebug. Finally after few hours, JetBrains Toolbox saved me.
But I must admit, Your anawer Andriy Bazanov was really helpfull, to realize that logs tells me "configuration is fine, but IDE just can't interpret breakpoints". Many thanks!
@L Raczka
>For me, the solution was to downgrade PhpStorm from 2020.3 to 2020.2.
Your situation is different (I mean: the reason behind it).
Please state your PHP and Xdebug versions.
Well, I had very similar logs from Xdebug. Please see below:
The status "break" comes from xdebug_break(); command.
PHP version 5.6
Xdebug: 2.2.5
@L Raczka
Thanks.
That's an issue in PhpStorm 2020.3. It is already fixed (WI-57282) for next minor 2020.3.1 version.
For the moment you either have to use previous 2020.2.4 or wait for 2020.3.1 release (2020.3.1 Preview build is already available; final version should be released in next 2 weeks (could be next Wednesday or one week later)).
Thanks a lot Andriy Bazanov !