PhpStorm 2020.3 not catching break points [XDebug 2.9.3] - SOLVED
Seems like with latest changes regarding XDebug (support for 3.0), PhpStorm 2020.3 is not catching anymore break points. I do see that connection gets established in Debugger, but none of the points which I set gets triggered. I even set to break script on first line as test, didn't work.
I have PHP Remote Debug setup for my local server. Everything worked just fine until new update came in (I use Snap version of installation for PhpStorm so I got my latest version right after the release). When I run Web Server Debug Validation, everything is set up just fine.
PHP version: PHP 7.1.33-24
XDebug version: Xdebug v2.9.3
Please sign in to leave a comment.
Hi there,
PhpStorm 2020.3 works well for me with Xdebug 3 (3.0.0. and 3.0.1 using PHP 8.0 and 7.4.13) as well as Xdebug 2.9.8 (PHP 7.4.13 and 7.3.25) here on Windows 10.
Please post your config:
I too have been having issues with xdebug in 2020.3 (and previous version?). I am debugging WordPress changes running PHPStorm on Windows 10 accessing a Linux server that has its files accessed via a shared folder. It will stop at the breakpoints, but then if I refresh the page it will not stop at any breakpoints. I have disabled caching at the browser, but this does not seem to have any effect. It will sometimes stop at a breakpoint again, then stop again. I have validated the xdebug installation using PHPStorm.
@Jim Lahm
You should really start separate thread here ... as based on your description you may be having a different issue here (even though some aspects might be the same for you) as it does not help mixing different but related things in one place.
In either case: you should provide details, like your Xdebug version, config, Xdebug log etc.
Validate Debugger info:
I already mention my php version and xdebug version in original post...
But here is more info:
Server info:
Xdebug from phpinfo:
```Enable debug log, restart PHP/web server and try to debug. Then share the xdebug log.``` - not sure I get this part?
@Pelesrb
>not sure I get this part?
xdebug.remote_log -- Xdebug will write the log with what it is doing (what commands it receives, what respond gets sent etc) there.
Anyway: you have Xdebug 2.9.3. Please upgrade to 2.9.6 or newer (latest for 2.9 branch is 2.9.8; latest overall is 3.0.1).
Based on your description it could be https://youtrack.jetbrains.com/issue/WI-56500#focus=Comments-27-4472478.0-0 -- Xdebug does not handle the "detach" command properly which cases issues on the server side (server restart is required in order to have Xdebug to work again); fixed in Xdebug 2.9.4 as per Xdebug ticket (or maybe 2.9.6 as that WI-56500 ticket suggests). JetBrains will introduce a workaround by not sending the required "detach" command if Xdebug v2.9.5 or older is used (targetting 2020.3.1 version).
I have the same problem with PHP 5.3, Xdebug 2.2.1 on Windows 7 64Bit.
Will file a bug report.
@Info / cal
>I have the same problem with PHP 5.3, Xdebug 2.2.1 on Windows 7 64Bit.
>Will file a bug report.
It's completely different issue (from what OP has here). Yours is https://youtrack.jetbrains.com/issue/WI-57282
Here is my xdebug log file contents:
[16645] Log opened at 2020-12-07 12:08:48
[16645] I: Connecting to configured address/port: localhost:9000.
[16645] I: Connected to client. :-)
[16645] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/html/advocate/api/res
t.php" language="PHP" xdebug:language_version="7.1.33-12+ubuntu18.04.1+deb.sury.org+1" protocol_version="1.0" appid="16645" idekey="PHPSTORM">
<engine version="2.9.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyri
ght><![CDATA[Copyright (c) 2002-2020 by Derick Rethans]]></copyright></init>
[16645] <- feature_set -i 1 -n show_hidden -v 1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" f
eature="show_hidden" success="1"></response>
[16645] <- feature_set -i 2 -n max_depth -v 1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" f
eature="max_depth" success="1"></response>
[16645] <- feature_set -i 3 -n max_children -v 100
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" f
eature="max_children" success="1"></response>
[16645] <- feature_set -i 4 -n extended_properties -v 1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" f
eature="extended_properties" success="1"></response>
[16645] <- feature_set -i 5 -n notify_ok -v 1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" f
eature="notify_ok" success="1"></response>
[16645] <- feature_set -i 6 -n resolved_breakpoints -v 1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="6" f
eature="resolved_breakpoints" success="1"></response>
[16645] <- stdout -i 7 -c 1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="7" succes
s="1"></response>
[16645] <- status -i 8
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="8" status
="starting" reason="ok"></response>
[16645] <- step_into -i 9
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="9" sta
tus="break" reason="ok"><xdebug:message filename="file:///var/www/html/advocate/api/rest.php" lineno="2"></xdebug:message></response>
[16645] <- breakpoint_set -i 10 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 18
0
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
0" id="166450001" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 11 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 16
6
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
1" id="166450002" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 12 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 17
5
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
2" id="166450003" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 13 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 18
1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
3" id="166450004" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 14 -t line -f file:///var/www/html/advocate/custom/include/Intelestream/Utilities/Notifiable.php -n 802
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
4" id="166450005" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 15 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 16
1
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
5" id="166450006" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 16 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 16
5
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
6" id="166450007" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 17 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 17
4
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
7" id="166450008" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 18 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 18
2
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
8" id="166450009" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 19 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 18
3
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1
9" id="166450010" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 20 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 15
9
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2
0" id="166450011" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 21 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 17
6
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2
1" id="166450012" resolved="unresolved"></response>
[16645] <- breakpoint_set -i 22 -t line -f file:///var/www/html/advocate/custom/modules/Opportunities/LogicHooks/InteleOppBeforeSave.php -n 17
9
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2
2" id="166450013" resolved="unresolved"></response>
[16645] <- stack_get -i 23
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="23"><s
tack where="{main}" level="0" type="file" filename="file:///var/www/html/advocate/api/rest.php" lineno="2"></stack></response>
[16645] <- run -i 24
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[U3R
hdHVzOiAzMDQgTm90IE1vZGlmaWVkDQo=]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[Q2F
jaGUtQ29udHJvbDogbWF4LWFnZT0wLCBwcml2YXRl]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo
=]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[RXh
waXJlczo=]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo
=]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[UHJ
hZ21hOg==]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo
=]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[Q29
udGVudC1MZW5ndGg6IDI=]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo
=]]></stream>
[16645] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo
=]]></stream>
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="24" status="
stopping" reason="ok"></response>
[16645] <- detach -i 25
[16645] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="25" statu
s="stopping" reason="ok"></response>
[16645] Log closed at 2020-12-07 12:08:50
Sorry, I just saw rest of your comment where you pointed me to track issue. So you believe that upgrade to newer version of xdebug would help me in this case?
@Pelesrb
>So you believe that upgrade to newer version of xdebug would help me in this case?
Yes, as per Xdebug ticket it should work OK since 2.9.4. But I would suggest latest 2.9.8 version anyway (v3 is not available for your PHP 7.1)
I have 2.9.8 and it works just fine for me (I'm on Windows using IIS as a web server though...)
P.S. https://youtrack.jetbrains.com/issue/WI-57282#focus=Comments-27-4572477.0-0 (Xdebug author on supported versions overall)
Tnx Andriy Bazanov! Xdebug upgrade to 2.9.8 did fix the issue. All running smooth again! However I do believe that you guys should release that fix for older versions of xdebug since someone might not be able to upgrade xdebug atm.
@Pelesrb
1) I do not work for JetBrains :)
2) As per my previous link: they plan to do something about it for 2020.3.1: https://youtrack.jetbrains.com/issue/WI-56500#focus=Comments-27-4576062.0-0
Thanks Andriy. Turns out upgrading to xdebug 2.9.6 as you suggested to others above solved my issue also.
Got the exact same problem, and I am not able to change the version of XDebug. Forced to downgrade to previous version, which is sad. Please fix ;)
Same problem. Force to rollback phpstorm version.
Having the problem as well. Attempting to build xdebug from source. If that doesn't fix it, will need to roll back PHPStorm to older version -- my clients are waiting.
Fixed by building and installing XDebug 3.1.0 from source. Ubuntu 20 defaults to an old version (2.9.2). Note you'll need to jigger around some of the settings in your php.ini for this to work, and change port 9000 to 9003 in IDE if using defaults.
I'd be interested to see your xdebug.ini as the phpstorm debug validation works with xdebug 3.0.1 but it won't stop on breakpoints for a request via a browser.
It worked fine with xdebug 2.9.2 and PHP 7.4 with phpstorm 2020.2. Upgrading to 2020.3 was less reliable so I upped xdebug to 3.0.1 and now
@Laurence Yates
Xdebug 3 uses different config params than v2.
Check https://xdebug.org/docs/upgrade_guide and update accordingly.
Almost all params have just different names. Default port number has changed though, so you may need to specify it manually if you did not do that for v2.
If you have questions: post your old working v2 and new v3 configs.
Thanks, I have tried several combinations of the new settings
for V2 I had
zend_extension=xdebug.so
xdebug.remote_host=wsl2.host
xdebug.remote_enable=On
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.show_error_trace = 1
xdebug.remote_autostart = 0
xdebug.file_link_format = phpstorm://open?%f:%l
xdebug.log = /home/lyates/xdebug.log
xdebug.log_level = 7
xdebug.remote_log=/var/log/xdebug/xdebug.log
xdebug.remote_host=wsl2.host
For V3 I currently have
xdebug.idekey = PHPSTORM
xdebug.log = /var/www/devroot/testmembers_wsl2/log/xdebug.log
xdebug.log_level = 7
#xdebug.remote_host=wsl2.host
## for xdebug 3
xdebug.client_host=ubuntu2004.wsl
xdebug.client_host=::
xdebug.client_port = 9003
xdebug.mode=debug
xdebug.start_with_request = yes
xdebug.discover_client_host = true
@Laurence Yates
Looks fine to me -- I see nothing super obviously wrong. Just few notes anyway:
1) v2 has xdebug.remote_host=wsl2.host while for v3 you put xdebug.client_host=ubuntu2004.wsl . Sadly I'm not WSL user so cannot say what host to be used here.
2) You also have 2 different xdebug.client_host entries for v3...
3) Ensure that Xdebug port in PhpStorm also 9003 (or just keep using 9000 as before). Ensure that PhpStorm is the one that listens on that port (e.g. "netstat -a -b" or alike) when "phone handle" icon is enabled.
4) xdebug.discover_client_host = true is an improved version of v2's xdebug.connect_back = 1. It should fallback to xdebug.client_host if not able to detect/connect. The log should mention this moment.
5) Please also check that those values are applied/live (Xdebug section of phpinfo() output or whole xdebug_info();)
Interested to see what Xdebug log says: where it tries to connect to and what the response is. It often helps a lot.
Based on your working v2 config it should be something like this for v3:
If still nothing: if you are interested we can run a quick TeamViewer session -- it's much easier to spot something with own eyes than asking bit by bit or missing some small nuances/clues. It could be some basic mistake in the end (had one case early today and one yesterday)
Thanks for the offer thats good of you , I'm in the UK so timezone might be an issue.
I just had it work briefly, trying to work back to see what I might have accidentally changed.
OK, If I explicitly set the host address then it is working. I know that can be automated, I'll just have to go back through my notes. I thought that using wsl2.host which is set to 172.31.0.1 in windows host would be enough but clearly it needs to be somewhere in Ubuntu as well.