XDebug Exits Wordpress Before It Ever Hits My Plugin (Works In VSCode) (Works For Non-WP Projects)

So I work locally on macos ventura with brew PHP, Nginx, MariaDB. Everything works great.

I can use XDebug for any and all project's in VSCode (includiong the wordpress ones).

Up until recently I was able to debug all project's in PHPStorm, but now my wordpress projects will not hit any of the breakpoints inside of my wp-content folders when running XDebug in PHPStorm. 

Debugging works if I set a breakpoint in the root wp-core index.php file and I can step into plenty of debugging of the wp-core files but the debugger never reaches any of my code breakpoints.

If I don't set the breakpoint on the first define in wp-core index.php, I get the notification “Debug session was finished without being paused”.

I'm using local install using zero-config debugging… which I know works as it works for all other projects… and technically it is working for wordpress but not hitting the code I need to debug.

I am using PHPStorm V.2023.3.4.

Have tried the following versions to no avail aswell:

  • 2024.1 EAP
  • 2023.2.5
  • 2023.1.5
  • 2022.3.3

Attached is the xdebug.log file from one request where the notification shows “Debug session was finished without being paused”.

If anyone can help, this is driving me mad and I'd really appreciate help or guidance on dissecting what the issue is, especially since it was working before.

[4178] Log opened at 2024-02-15 22:42:51.067532
[4178] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION'
[4178] [Config] INFO: No shared secret: Activating
[4178] [Step Debug] INFO: Connecting to configured address/port: localhost:9003.
[4178] [Step Debug] INFO: Connected to debugging client: localhost:9003 (through xdebug.client_host/xdebug.client_port).
[4178] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///Users/xxx/Web/Sites/wpclassic/public_html/index.php" language="PHP" xdebug:language_version="8.2.15" protocol_version="1.0" appid="4178" idekey="XDEBUG_ECLIPSE"><engine version="3.3.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2023 by Derick Rethans]]></copyright></init>

[4178] [Step Debug] <- feature_set -i 1 -n show_hidden -v 1
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

[4178] [Step Debug] <- feature_set -i 2 -n max_depth -v 1
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

[4178] [Step Debug] <- feature_set -i 3 -n max_children -v 100
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>

[4178] [Step Debug] <- feature_set -i 4 -n extended_properties -v 1
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="extended_properties" success="1"></response>

[4178] [Step Debug] <- feature_set -i 5 -n notify_ok -v 1
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="notify_ok" success="1"></response>

[4178] [Step Debug] <- feature_set -i 6 -n resolved_breakpoints -v 1
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="6" feature="resolved_breakpoints" success="1"></response>

[4178] [Step Debug] <- feature_set -i 7 -n breakpoint_include_return_value -v 1
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="7" feature="breakpoint_include_return_value" success="1"></response>

[4178] [Step Debug] <- stdout -i 8 -c 1
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="8" success="1"></response>

[4178] [Step Debug] <- status -i 9
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="9" status="starting" reason="ok"></response>

[4178] [Step Debug] <- step_into -i 10
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="10" status="break" reason="ok"><xdebug:message filename="file:///Users/xxx/Web/Sites/wpclassic/public_html/index.php" lineno="14"></xdebug:message></response>

[4178] [Step Debug] <- eval -i 11 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="11"><property type="bool"><![CDATA[0]]></property></response>

[4178] [Step Debug] <- eval -i 12 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="12"><property type="bool"><![CDATA[1]]></property></response>

[4178] [Step Debug] <- eval -i 13 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13"><property type="string" size="14" encoding="base64"><![CDATA[d3BjbGFzc2ljLnRlc3Q=]]></property></response>

[4178] [Step Debug] <- eval -i 14 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9QT1JUJ10p
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="14"><property type="string" size="3" encoding="base64"><![CDATA[NDQz]]></property></response>

[4178] [Step Debug] <- eval -i 15 -- KHN0cmluZykoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10p
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="15"><property type="string" size="1" encoding="base64"><![CDATA[Lw==]]></property></response>

[4178] [Step Debug] <- breakpoint_set -i 16 -t line -f file:///Users/xxx/Web/Sites/wpclassic/public_html/wp-content/themes/finna/page-templates/page_full-width.php -n 16
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="16" id="41780019" resolved="unresolved"></response>

[4178] [Step Debug] <- breakpoint_set -i 17 -t line -f file:///Users/xxx/Web/Sites/wpclassic/public_html/wp-content/themes/finna/inc/Api/Customizer/Header.php -n 70
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="17" id="41780020" resolved="unresolved"></response>

[4178] [Step Debug] <- breakpoint_set -i 18 -t line -f file:///Users/xxx/Web/Sites/wpclassic/public_html/wp-content/themes/finna/page-templates/page_full-width.php -n 21
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="18" id="41780021" resolved="unresolved"></response>

[4178] [Step Debug] <- stack_get -i 19
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="19"><stack where="{main}" level="0" type="file" filename="file:///Users/xxx/Web/Sites/wpclassic/public_html/index.php" lineno="14"></stack></response>

[4178] [Step Debug] <- run -i 20
[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[WC1Qb3dlcmVkLUJ5OiBQSFAvOC4yLjE1]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[RXhwaXJlczogV2VkLCAxMSBKYW4gMTk4NCAwNTowMDowMCBHTVQ=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[Q2FjaGUtQ29udHJvbDogbm8tY2FjaGUsIG11c3QtcmV2YWxpZGF0ZSwgbWF4LWFnZT0wLCBuby1zdG9yZSwgcHJpdmF0ZQ==]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[Q29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTg=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[TGluazogPGh0dHBzOi8vd3BjbGFzc2ljLnRlc3Qvd3AtanNvbi8+OyByZWw9Imh0dHBzOi8vYXBpLncub3JnLyI=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[TGluazogPGh0dHBzOi8vd3BjbGFzc2ljLnRlc3Qvd3AtanNvbi93cC92Mi9wYWdlcy8xODMyPjsgcmVsPSJhbHRlcm5hdGUiOyB0eXBlPSJhcHBsaWNhdGlvbi9qc29uIg==]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[TGluazogPGh0dHBzOi8vd3BjbGFzc2ljLnRlc3QvPjsgcmVsPXNob3J0bGluaw==]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[PCFET0NUWVBFIGh...]]></stream>

[4178] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[PGxpbmsgcmVs...]]></stream>

[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="20" status="stopping" reason="ok"></response>

[4178] [Step Debug] <- detach -i 21
[4178] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="21" status="stopping" reason="ok"></response>

[4178] Log closed at 2024-02-15 22:42:51.366501
0
1 comment

I've seen that happen to me too sometimes, not on wordpress but other systems.  What I do is walk manually down into where my function should be entered into.  Usually the debugging panel turns into a message saying “this file is not mapped” with a link that opens up the SETTINGS → PHP → SERVERS  panel and i need to put in an absolute path to the folder where the code is or fiddle with the folder.

after that it works.

0

Please sign in to leave a comment.