View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001269 | Xdebug | Uncategorized | public | 2016-02-15 19:42 | 2025-11-25 14:22 |
| Reporter | reyncor | Assigned To | |||
| Priority | high | Severity | major | Reproducibility | always |
| Status | acknowledged | Resolution | suspended | ||
| Platform | All | OS | Fedora | OS Version | 23 |
| Product Version | 2.3.3 | ||||
| Target Version | 3.6dev | ||||
| Summary | 0001269: xdebug_break() does not work in PHP Interactive Shell | ||||
| Description | Any attempt to run xdebug_break() will be ignored when running with php -a -d xdebug.idkey=atom Even, "include 'file.php'" fails to trigger a break with xdebug_break(); | ||||
| Steps To Reproduce |
The code will not break. | ||||
| Tags | No tags attached. | ||||
| Operating System | Fedora 23 | ||||
| PHP Version | 8.0-dev | ||||
|
|
Have you exported the environment variable XDEBUG_CONFIG on the shell? If I run it like this: XDEBUG_CONFIG="idekey=dr" php -a -d xdebug.remote_enable=1 Then it connects to the debugger, and stops at the xdebug_break() just fine. |
|
|
Ping? |
|
|
I could be missing something but I just tried (using 'debugclient' that comes with the extension) and it doesn't seem to be working :/ After including PHP file the client receives INIT package like this: <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///home/pc/test_dir/test.php" language="PHP" xdebug:language_version="5.5.9-1ubuntu4.14" protocol_version="1.0" appid="16880" idekey="dr"><engine version="2.4.0RC5-dev"><![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> This is great, but then after: 'run -i 1' the PHP script executes completely without breaking and 'debugclient' prompt stays busy. Only after I quit PHP the client prompt returns with a package like this: <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="1" status="stopping" reason="ok"></response> === I tried the same PHP script in non-interactive mode it works as expected. <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="1" status="break" reason="ok"><xdebug:message filename="file:///home/pc/test_dir/test.php" lineno="8"></xdebug:message></response> === Am I doing it wrong? Could it be PHP version? I'm on master branch of xdebug (commit: f4c6c8c). Thanks! |
|
|
Hi, I've spend some more time figuring out what the problem is. I can indeed reproduce this now. xdebug_break() works by setting a flag (XG(context).do_break) to 1, which then For some reason, the intermediate Even when forcing that with the additional -e argument to PHP, this does not I will have to suspend this until the appropriate steps can be taken in PHP cheers, |
|
|
In Php > 8, it works, but only once at debugger session. In Xdebug 3.3.0 it activates by whatever command is executed first, and also only once per session. |
|
|
I meant once per PHP interactive shell session |
|
|
@anton.m4354 -- that would make sense, as that is when Xdebug would initiate the debugging connection |