We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Xdebug PhpStorm cant break in any controller

I found strange behaviour in xdebug xdebug ignore breakpoint in my controller but I can trace it (from index.php) untul it break in my controller. Also it can break on xdebug_break()

Here is some log in from xdebug remote log

3:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="145" id="25220003"></response> 29:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="4" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/public/index.php" lineno="18"></xdebug:message></response> 31:<- breakpoint_set -i 5 -t line -f file:///var/www/licman/app/modules/admin/controllers/SessionController.php -n 38 32:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="25230001"></response> 34:<- breakpoint_set -i 6 -t line -f file:///var/www/licman/public/index.php -n 22 35:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="25230002"></response> 41:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/public/index.php" lineno="22"></xdebug:message></response>

And here is log when I trace it till SessionController

29:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="4" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/public/index.php" lineno="18"></xdebug:message></response> 31:<- breakpoint_set -i 5 -t line -f file:///var/www/licman/app/modules/admin/controllers/SessionController.php -n 38 32:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="25250001"></response> 34:<- breakpoint_set -i 6 -t line -f file:///var/www/licman/app/PluginInitialization.php -n 30 35:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="25250002"></response> 41:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/PluginInitialization.php" lineno="30"></xdebug:message></response> 56:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="13" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/PluginInitialization.php" lineno="32"></xdebug:message></response> 71:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="18" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/PluginInitialization.php" lineno="40"></xdebug:message></response> 86:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="23" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Module.php" lineno="62"></xdebug:message></response> 101:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="28" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Module.php" lineno="41"></xdebug:message></response> 116:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="33" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Module.php" lineno="42"></xdebug:message></response> 131:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="38" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Module.php" lineno="43"></xdebug:message></response> 146:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="43" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Module.php" lineno="57"></xdebug:message></response> 161:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="48" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/vendor/composer/ClassLoader.php" lineno="269"></xdebug:message></response> 176:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="53" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/vendor/composer/ClassLoader.php" lineno="270"></xdebug:message></response> 191:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="58" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/vendor/composer/ClassLoader.php" lineno="272"></xdebug:message></response> 206:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="63" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Controllers/SessionController.php" lineno="37"></xdebug:message></response> 221:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="68" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Controllers/SessionController.php" lineno="38"></xdebug:message></response> 236:-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="73" status="break" reason="ok"><xdebug:message filename="file:///var/www/licman/app/Modules/Admin/Controllers/SessionController.php" lineno="39"></xdebug:message></response>

Is there any solution for my problem?

Did you ever get a resolution for this? I am getting a similar problem.



7.9k

hello,

you can add xdebugbreak() in your php code. So debugger will break on that command, I think that is the only way

Thank you, that got me further along. It would then break, but not synchronize the file view with the debug console.

I then found that PHPStorm's automatic server path mapping had mapped my /public directory where my index.php bootstrap file is, but not my root directory just above it, so nothing in the app directories would be found. I used the dialog described in this link to add a mapping for my root and now all is well, no need even for xdebug_break() any more.

https://www.jetbrains.com/phpstorm/webhelp/override-server-path-mappings-dialog.html

I hope this helps you too.