PHPSTORM not receiving debug connection from xdebug 2.5

Answered

I've been following this guide: https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm

i am able to reach step 6 but don`t get a Incoming Connection From Xdebug on step 7.

(tldr:ive setup the xdebug and validated debugconfig however when i use the bookmark for starting the debugger, nothing happens no errors nothing)

This is my first time using xdebug so im not even sure how to validate that xdebuger is sending out IDEKEY, or if there is some other config in phpstorm i havent done.

 

The quick and dirty:

win 10 x64 running an IIS server locally, PHP 7.0.9, xdebug 2.5.0rc1

php.ini ext settings:

[xdebug]
zend_extension = C:\Program Files\PHP\v7.0\ext\php_xdebug-2.5.0rc1-7.0-vc14-nts-x86_64.dll
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_enable=1
xdebug.remote_idekey="PHPSTORM"

more detailed look at xdebugger settings under phpinfo();:

xdebug

xdebug support enabled
Version 2.5.0rc1
IDE Key PHPSTORM
Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $
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.force_display_errors Off Off
xdebug.force_error_reporting 0 0
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 Off Off
xdebug.profiler_enable_trigger_value no value no value
xdebug.profiler_output_dir /tmp /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 localhost localhost
xdebug.remote_log no value no value
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
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 C:\Windows\Temp C:\Windows\Temp
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

 

0
18 comments

Hi there,

1) Please collect xdebug log for such unsuccessful debug session and share it: https://xdebug.org/docs/all_settings#remote_log

2) As I understand you are using 64-bit PHP?

3) Ensure that firewall allows incoming connections for PhpStorm executable file that you are using (phpstorm.exe for 32 bit Java and phpstorm64.exe for 64-bit)

4) After you enable "phone handle" icon -- please check with netstat or any other tool that PhpStorm is the app that is listening on that port

5) You can try with xdebug.remote_autostart=1 in your php.ini -- this will remove the need for any xdebug cookie/parameter .. but xdebug will attempt to debug every single script (not convenient for day-to-day usage .. but for investigation will do)

6) Place programmatic breakpoint into your code ( xdebug_break(); ) -- any difference?

7) Some small screencast might help as well (with some settings overview + actual debugging attempt -- maybe you are doing something wrongly)

0

1. Log info

Log opened at 2016-11-17 04:43:03
I: Connecting to configured address/port: 127.0.0.1:9000.
W: Creating socket for '127.0.0.1:9000', WSAPoll: 10022.
E: Could not connect to client. :-(
Log closed at 2016-11-17 04:43:03


Log opened at 2016-11-17 04:45:21
I: Connecting to configured address/port: 127.0.0.1:9000.
W: Creating socket for '127.0.0.1:9000', WSAPoll: 10022.
E: Could not connect to client. :-(
Log closed at 2016-11-17 04:45:21

 

2. yes 64bit php

3. i allowed all connections inbound and outbound for port 9000( i also added exceptions for the program itself not working either)

4.can confirm phpstorm is listening using resource monitor 

5.this doesn't seem to have done anything?

6.this doesnt seem to have done anything either.

7.



0

Try xdebug stable (2.4.x) instead of your 2.5 RC. Also re-check your firewall (maybe disable it for the moment completely). Same applies to any AntiVirus/InternetSecurity solutions that you may have there.

Your xdebug clearly shows that connection to 127.0.0.1:9000 has failed (for whatever reason; I assume that "phone handle" icon was active at that moment and PhpStorm was listening).

I'm on Windows 10 Pro x64; PHP 7.0 & 5.6 x32; xdebug 2.4.1; IIS; KAV... and it all works just fine.

1

This is how xdebug logs looks for me (first few lines)

Log opened at 2016-11-17 21:29:31
I: Connecting to configured address/port: 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///E:/Projects/web/_idetest/test.php" language="PHP" xdebug:language_version="5.6.1-dev" protocol_version="1.0" appid="11204" idekey="18261"><engine version="2.4.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2016 by Derick Rethans]]></copyright></init>


Compare it to yours:

I: Connecting to configured address/port: 127.0.0.1:9000.
W: Creating socket for '127.0.0.1:9000', WSAPoll: 10022.

0

YES! changing to xdebug 2.4.1 worked i spend an entire day on that : | thanks

4

I had the same problem. Reverted from php_xdebug-2.5.0rc1-5.6-vc11-nts.dll to php_xdebug-2.4.1-5.6-vc11-nts.dll and my problem was fixed too. I only wasted a few hours on this :-S Thanks for posting and sorry to hear it wasted a day. I would have spent a lot longer trying to debug this before I tried to revert to a previous version of xdebug if it wasn't for your post.

3

I wished had found this sooner. Reverting from 2.5 to 2.4.1 solved my problem too.

1

Arrrghh. Spent hours on that. I had exactly the same error and using XDebug 2.4.1 instead of 2.5.0 (php_xdebug-2.5.0rc1-5.6-vc11.dll) solved the problem for me too. In the meantime there is a new XDebug release for 2.5.0 available (php_xdebug-2.5.0-5.6-vc11.dll). This newer version works also!

Log opened at 2017-01-04 19:26:56
I: Connecting to configured address/port: 127.0.0.1.localhost:9000.
I: Connected to client. :-)

So many thanks. You made my day.

0

2.5.0's been working perfectly for me.

Not sure about everyone's issue with this, but I think the OP's was due to this line:

    xdebug.remote_host=localhost

For debugging on remote servers the host IP address needs to be set to the IP address of the machine running PhpStorm, not the server running Xdebug; if it's set to 'localhost' Xdebug tries to connect to the server it's running on.

Alternatively, Xdebug can work out the IP address of the machine that made the debug request by adding this line to php.ini:

    xdebug.remote_connect_back=1

 

0

@Chris Bradbury

>2.5.0's been working perfectly for me.

xdebug 2.5 RC1 had issues on Windows (Mac and Linux were OK) -- see links to xdebug bug tickets in this comment: https://intellij-support.jetbrains.com/hc/en-us/community/posts/205979264/comments/205093024

That's the OS and xdebug version that OP has used at that time.

xdebug 2.5.0 final has that issue resolved.

 

>Not sure about everyone's issue with this, but I think the OP's was due to this line:
>
>    xdebug.remote_host=localhost

OP has local server so this setting is correct

 

>For debugging on remote servers the host IP address needs to be set to the IP address of the machine running PhpStorm, not the server running Xdebug; if it's set to 'localhost' Xdebug tries to connect to the server it's running on.

In general -- you are absolutely correct. But it's not the case when xdebug DBGp proxy is used or debugging is done via SSH -- in that case it can/should be localhost as well.

0

My bad, I thought from my reading of it he was running remotely.

I'd originally been using trying out the RC at Derick's request due to an issue debugging static methods with various PHP versions and had it working fine (I was working on Linux at the time, so that'll be why), so assumed that might be the issue.

Cheers for clearing it up.

0

I've struggled for days to get PHPStorm remote debugging to work with php 7.1- xdebug 2.5+. I've tried different port numbers, compiling different versions of xdebug, 2.6, 2.7 alpha, etc. but to no avail. I just keep getting the "Debug session was finished without being paused" message every time.

Xdebug config:

xdebug.remote_autostart=0

xdebug.remote_enable=1

xdebug.default_enable=0

xdebug.show_error_trace=1

xdebug.remote_host=docker.for.mac.host.internal

xdebug.remote_port=9071

xdebug.remote_connect_back=0

xdebug.profiler_enable=0

xdebug.remote_log="/tmp/xdebug.log"

xdebug.scream=0

xdebug.show_local_vars=1

xdebug.idekey=PHPSTORM

xdebug.var_display_max_depth=1000

xdebug.var_display_max_children=256

xdebug.var_display_max_data=4096

request_terminate_timeout=600s

 

I have no problems debugging with a similar setup on php 5.6 - xdebug 2.2.

 

0

@Adresden

Your case is different to the one that OP had. Do not mix them -- better make a separate thread and provide xdebug log there (you may also provide xdebug section of phpinfo() output captured via browser -- to check the live values).

0

Who is OP? I cannot mix with that of which I know not of. I can paste the output of the xdebug log, but have you ever actually tried to read that thing, let alone make sense of it? Nevertheless, I shall supply more detailed information in a separate post, if it helps clarify the trouble I'm having.

0

>Who is OP?

Original Poster --  then one who created this thread. Standard abbreviation.

>but have you ever actually tried to read that thing, let alone make sense of it?

Of course not -- I've asked that just for fun. What else can I do here?

But to answer it seriously: yes. It's not to read all details .. but at least to see the general picture (if it connects at all; general flow etc)

 

The request to have all that in a separate post is:

  • to not to send email notifications to people who participated in original problem (especially since this thread is marked as answered)
  • this thread was about specific issue with specific xdebug build on specific OS only -- it was not reproducible on non-Windows OS or different xdebug version. So it's not your case for sure.
  • keep thread shorter in general: no need to always scroll down past old entries to find recent post
0

Damn, well OK then, there's yet another "standard abbreviation" I'll have to try to remember. Now that we've all got that sorted, what do you suggest I title my new post? Since "PHPSTORM not receiving debug connection from xdebug 2.5" is already taken, what would you suggest? And how much of the xdebug.log file should I post? Since you only require a "general picture", how general must that general picture be?

0

>what do you suggest I title my new post?

You can name it as you wish .. even general "PhpStorm and xdebug setup issues". I doubt that there is a unique title requirement here.

>And how much of the xdebug.log file should I post?

One debug session/attempt is enough to see if it connects or not. Then there will be other questions once general picture is visible.

Describe your setup in details -- the more the better... since I have no clue at all about your setup. Something that is not important for you may give clues/answer to another person.

You said it works in another container/xdebug version. So you need xdebug log and actual xdebug settings at very least (from phpinfo() output)

0

Turns out my problem was caused by a Drupal 8 caching issue. https://www.drupal.org/node/2598914

Debugging is working fine now after making the changes recommended in that guide.

0

Please sign in to leave a comment.