Vscode-php-debug: VSCode doesn't stop on breakpoint in case of AJAX call

Created on 4 May 2017  路  11Comments  路  Source: xdebug/vscode-php-debug

PHP version: 5.6.30
XDebug version: 2.2.5
Adapter version: N/A

Your launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "log": true
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

XDebug php.ini config:

zend_extension=/opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.idekey="vscode"
xdebug.remote_log=/opt/lampp/logs/xdebug

XDebug logfile (from setting xdebug.remote_log in php.ini):

Log opened at 2017-05-04 15:21:01
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/index.php" language="PHP" protocol_version="1.0" appid="3480" idekey="vscode"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_set -i 2 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="34800001"></response>

<- breakpoint_list -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="3"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34800001"></breakpoint></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34800001"></breakpoint></response>

<- breakpoint_set -i 5 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="34800002"></response>

<- run -i 6
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="6" status="stopping" reason="ok"></response>

<- stop -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="7" status="stopped" reason="ok"></response>

Log closed at 2017-05-04 15:21:02

Log opened at 2017-05-04 15:21:02
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/common/contentLoader/loader.php" language="PHP" protocol_version="1.0" appid="3480" idekey="vscode"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

Log opened at 2017-05-04 15:21:02
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/common/sideMenuLoader/sideMenuLoader.php" language="PHP" protocol_version="1.0" appid="3481" idekey="vscode"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- breakpoint_set -i 2 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="34800003"></response>

<- breakpoint_list -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="3"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34800003"></breakpoint></response>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34800003"></breakpoint></response>

<- breakpoint_list -i 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="2"></response>

<- breakpoint_remove -i 5 -d 34800003
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_remove" transaction_id="5"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34800003"></breakpoint></response>

<- breakpoint_set -i 3 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3" id="34810001"></response>

<- breakpoint_set -i 6 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="34800004"></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34810001"></breakpoint></response>

<- breakpoint_list -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="7"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34800004"></breakpoint></response>

<- breakpoint_set -i 8 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="8" id="34800005"></response>

<- breakpoint_set -i 5 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="34810002"></response>

<- breakpoint_list -i 9
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="9"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34800004"></breakpoint><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="34800005"></breakpoint></response>

<- breakpoint_list -i 6
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="6"><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="34810002"></breakpoint><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34810001"></breakpoint></response>

<- run -i 10
<- run -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="10" status="break" reason="ok"><xdebug:message filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179"></xdebug:message></response>

<- breakpoint_list -i 11
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="11"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="1" hit_value="0" id="34800004"></breakpoint><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="34800005"></breakpoint></response>

<- breakpoint_remove -i 12 -d 34800005
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_remove" transaction_id="12"><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="34800005"></breakpoint></response>

<- breakpoint_set -i 13 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="13" id="34800006"></response>

<- stop -i 14
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="14" status="stopped" reason="ok"></response>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="14" status="stopping" reason="ok"></response>

Log closed at 2017-05-04 15:29:57

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="7" status="stopping" reason="ok"></response>

<- breakpoint_list -i 8
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="8"><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="34810002"></breakpoint><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="34810001"></breakpoint></response>

<- stop -i 9
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="9" status="stopped" reason="ok"></response>

Log closed at 2017-05-04 15:29:57

Log opened at 2017-05-04 15:29:57
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
Log closed at 2017-05-04 15:29:57

Log opened at 2017-05-04 15:30:12
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
Log closed at 2017-05-04 15:30:12

Log opened at 2017-05-04 15:30:12
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
Log closed at 2017-05-04 15:30:12

Log opened at 2017-05-04 15:30:12
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
Log closed at 2017-05-04 15:30:12

Log opened at 2017-05-04 15:30:13
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
Log closed at 2017-05-04 15:30:13

Log opened at 2017-05-04 15:30:20
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/index.php" language="PHP" protocol_version="1.0" appid="3518" idekey="PHPSTORM"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_set -i 2 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="35180001"></response>

<- breakpoint_list -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="3"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180001"></breakpoint></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180001"></breakpoint></response>

<- breakpoint_set -i 5 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="35180002"></response>

<- run -i 6
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="6" status="stopping" reason="ok"></response>

<- stop -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="7" status="stopped" reason="ok"></response>

Log closed at 2017-05-04 15:30:20

Log opened at 2017-05-04 15:30:21
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/common/contentLoader/loader.php" language="PHP" protocol_version="1.0" appid="3518" idekey="vscode"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

Log opened at 2017-05-04 15:30:21
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/common/sideMenuLoader/sideMenuLoader.php" language="PHP" protocol_version="1.0" appid="4118" idekey="vscode"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_set -i 2 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="35180003"></response>

<- breakpoint_list -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="3"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180003"></breakpoint></response>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180003"></breakpoint></response>

<- breakpoint_list -i 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="2"></response>

<- breakpoint_remove -i 5 -d 35180003
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_remove" transaction_id="5"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180003"></breakpoint></response>

<- breakpoint_set -i 3 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3" id="41180001"></response>

<- breakpoint_set -i 6 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="35180004"></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="41180001"></breakpoint></response>

<- breakpoint_list -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="7"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180004"></breakpoint></response>

<- breakpoint_set -i 8 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="8" id="35180005"></response>

<- breakpoint_set -i 5 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="41180002"></response>

<- breakpoint_list -i 9
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="9"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180004"></breakpoint><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="35180005"></breakpoint></response>

<- breakpoint_list -i 6
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="6"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="41180001"></breakpoint><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="41180002"></breakpoint></response>

<- run -i 10
<- run -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="10" status="break" reason="ok"><xdebug:message filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179"></xdebug:message></response>

<- breakpoint_list -i 11
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="11"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="1" hit_value="0" id="35180004"></breakpoint><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="35180005"></breakpoint></response>

<- breakpoint_remove -i 12 -d 35180005
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_remove" transaction_id="12"><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="35180005"></breakpoint></response>

<- breakpoint_set -i 13 -t exception -x *
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="13" id="35180006"></response>

Log opened at 2017-05-04 15:31:14
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/login/expire.php" language="PHP" protocol_version="1.0" appid="3519" idekey="vscode"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

Log opened at 2017-05-04 15:31:14
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/index.php" language="PHP" protocol_version="1.0" appid="3480" idekey="vscode"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- breakpoint_list -i 14
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="14"><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="35180006"></breakpoint><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="1" hit_value="0" id="35180004"></breakpoint></response>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_list -i 15
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="15"><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="35180006"></breakpoint><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="1" hit_value="0" id="35180004"></breakpoint></response>

<- breakpoint_list -i 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="2"></response>

<- breakpoint_list -i 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="2"></response>

<- breakpoint_remove -i 16 -d 35180004
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_remove" transaction_id="16"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="1" hit_value="0" id="35180004"></breakpoint></response>

<- breakpoint_set -i 3 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3" id="35190001"></response>

<- breakpoint_set -i 3 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3" id="34800007"></response>

<- breakpoint_remove -i 17 -d 35180004
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_remove" transaction_id="17" status="break" reason="ok"><error code="205"><message><![CDATA[no such breakpoint]]></message></error></response>

<- breakpoint_set -i 4 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4" id="35190002"></response>

<- breakpoint_set -i 18 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="18" id="35180007"></response>

<- breakpoint_set -i 4 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4" id="34800008"></response>

<- run -i 5
<- run -i 5
<- breakpoint_list -i 19
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="19"><breakpoint type="exception" state="enabled" hit_count="0" hit_value="0" id="35180006"></breakpoint><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180007"></breakpoint></response>

<- breakpoint_remove -i 20 -d 35180007
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_remove" transaction_id="20"><breakpoint type="line" filename="file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php" lineno="179" state="enabled" hit_count="0" hit_value="0" id="35180007"></breakpoint></response>

Adapter logfile (from setting "log": true in launch.json):
js Thread { id: 4, name: 'Request 4 (5:31:14 PM)' }, Thread { id: 5, name: 'Request 5 (5:31:14 PM)' } ] } } -> setBreakpointsRequest { command: 'setBreakpoints', arguments: { source: { path: '/media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php' }, lines: [], breakpoints: [], sourceModified: false }, type: 'request', seq: 25 }

Code snippet to reproduce:

  1. create a simple php file (variable assignment and echo this variable)
  2. using JS, send an AJAX request to the above php file (you should get in response the value of the variable, from the echo)
  3. set a breakpoint in the php file on the "echo" line
  4. send the AJAX request again
  5. the request will have no response, meaning, xdebug stopped the execution but vscode doesn't hit the breakpoint

NOTE: this is an old issue with xdebug, to solve it, xdebug gives 'idekey' which should be attached to the AJAX call. Netbeans, PHPStorm and other IDEs implemented a debugger using this 'idekey', but it seems like your debugger doesn't handle it.

All 11 comments

What exactly is the debugger supposed to do with the IDE key? How would it help?

I'm not a system guy, so excuse me if I'm wrong... :)

As far as I understand, when launching the debugger, it creates a session. AJAX call creates a separated session, which makes the debugger ignore the breakpoint.
The 'idekey' is kind of session identifier.

So, in my php.ini there is idekey configured ("vscode" I called it) and I attach the same key to the AJAX call, but no success. The execution of the php code is actually stopped but vscode doesn't trigger the breakpoint.

Again, I'm only a web developer and might be wrong about this technicality of the web server and the debugger, but maybe this link can help more:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206548529-Debug-PHP-application-which-originates-from-AJAX-request

Your XDebug log contains multiple connections. XDebug seems to report the stop event correctly. Can you tell me the log line where it fails?

<- breakpoint_set -i 2 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="34800001"><

Sorry for not cleaning the log file before posting, my bad...

And I believe Xdebug reports correctly because the execution of the file stops and I get no response for the AJAX call. I think the problem is that the debugger refer to this report as not relevant.

Also, if I try to debug a direct php file (not by AJAX call) it works perfectly.

Did you try to _not_ set the IDE key?

Yes, but no success.
I commented the line in php.ini but then there is a default value root:

screenshot from 2017-05-05 13-43-09

And also removed the idekey from the AJAX call.
That's the Xdebug log:

```Log opened at 2017-05-05 11:36:49
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
->

<- breakpoint_list -i 1
->

<- breakpoint_set -i 2 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
->

<- breakpoint_list -i 3
->

<- breakpoint_list -i 4
->

<- breakpoint_set -i 5 -t exception -x *
->

<- run -i 6
->

<- stop -i 7
->

Log closed at 2017-05-05 11:36:49

Log opened at 2017-05-05 11:36:50
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
->

Log opened at 2017-05-05 11:36:50
<- breakpoint_list -i 1
->

I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
->

<- breakpoint_set -i 2 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
->

<- breakpoint_list -i 3
->

<- breakpoint_list -i 1
->

<- breakpoint_list -i 4
->

<- breakpoint_list -i 2
->

<- breakpoint_list -i 5
->

<- breakpoint_list -i 3
->

<- breakpoint_remove -i 6 -d 289410003
->

<- breakpoint_set -i 4 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
->

<- breakpoint_set -i 7 -t exception -x *
->

<- breakpoint_set -i 5 -t exception -x *
->

<- breakpoint_set -i 8 -t line -f file:///media/WinOS/Users/Liron/Documents/www/MegaArchive/src/viewer/php/contentLoader/impl/single/artist.php -n 179
->

<- run -i 9
<- run -i 6
->

<- breakpoint_list -i 10
->
```

I am facing the same issue. PHP Debug _does not_ work on AJAX request.
Someone please fix this

@alisajidcs why don't you fix it? :)

If I could, I wouldn't have asked you in first place :@

[Solved]
The issue is not in the tool. Just put this in your _php.ini_ file and it will work

xdebug.remote_autostart = on

You can close this issue now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eghoff1 picture eghoff1  路  10Comments

evs-xsarus picture evs-xsarus  路  5Comments

smuuf picture smuuf  路  10Comments

camrongodbout picture camrongodbout  路  5Comments

PipCodeBoy picture PipCodeBoy  路  5Comments