Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Debugger does not stop at breakpoint

2008-09-24
2013-05-21
  • Hi,

    I know there is a similar thread but I like to verify that in my thread are only my config details and the answers are not mixed. Please excuse my decision ;).

    I use Windows VISTA with XAMPP and Notepad++ 5.0.3.
    PHP uses 5.2.5.
    My Apache runs at Port 100 instead of 80.
    xdebug is version php_xdebug-2.0.3-5.2.5

    I installed everything like is was described in the following URL:
    http://www.judiwa.com/wiki/How_to_Setup_BDGp_debugger_in_Notepad%2B%2B_to_Debug_PHP

    A breakpoint was set in my testfile on row 2:
    <?php
        for ( $i=1; $i<10; $i++)
        {
            echo "<br>Line $i";
        }
    ?>

    My DBG Raw show the following Log:

    Accept: 127.0.0.1
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///D:/xampplite/htdocs/test.php" language="PHP" protocol_version="1.0" appid="4068" idekey="check"><engine version="2.0.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2008 by Derick Rethans]]></copyright></init>
    Send: source -i 1 -f file:///D:/xampplite/htdocs/test.php
    Send: feature_set -i 2 -n max_depth -v 3
    Send: feature_set -i 3 -n max_children -v 15
    Send: breakpoint_set -i 4 -t line -f file:///D:/xampplite/htdocs/test.php -n 2 -s enabled -h 0 -o >=
    Send: breakpoint_list -i 5
    Send: step_into -i 6
    ----
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="source" transaction_id="1" encoding="base64"><![CDATA[PD9waHANCiAgICBmb3IgKCAkaT0xOyAkaTwxMDsgJGkrKykgDQoJew0KICAgICAgICBlY2hvICI8YnI+TGluZSAkaSI7DQogICAgfQ0KPz4NCg==]]></response>
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4" state="enabled" id="40680003"></response>
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="5"><breakpoint type="line" filename="file:///D:/xampplite/htdocs/test.php" lineno="2" state="enabled" hit_count="0" hit_condition="&gt;=" hit_value="0" id="40680003"></breakpoint></response>
    Recv: <?xml version="1.0" encoding="iso-8859-1"?>
    <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="6" status="stopping" reason="ok"></response>
    Send: run -i 7
    ----
    Disconnect: 127.0.0.1

    It does not stop at the breakpoint in the debugger. I used the following URL to start the debug mode:
    http://localhost:100/test.php?XDEBUG_SESSION_START=check

    The page was loaded and executes the whole script and does not stop at the Point or anywhere else. The site was completly loaded and then you see the RAW output which was postet above.

    The config of the DLL in notepad++ contains:

    127.0.0.1
    empty
    d:\xampplite\htdocs
    d:\xampplite\htdocs

    The php.ini contains the following parameters for the xdebug:

    extension=php_xdebug-2.0.3-5.2.5.dll
    ; XDEBUG START
    ;zend_extension_ts="d:/xampplite/php/ext/php_xdebug-2.0.3-5.2.5.dll"
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_host=127.0.0.1
    xdebug.remote_mode=req
    xdebug.idekey=default
    xdebug.remote_log="D:/xdebug.log"
    xdebug.remote_port=9000
    xdebug.show_exception_trace=0
    xdebug.show_local_vars=9
    xdebug.show_mem_delta=0
    xdebug.trace_format=0
    ; XDEBUG ENDE

    If I use the ZEND parameter my apache starts but colapse when I call phpinfo in a testfile. So I deceide to use the "extension=..." variant.

    Please help me. I tried many things but don't come further.

     
    • Damjan Cvetko
      Damjan Cvetko
      2008-09-25

      Hi Elektroschnitzel. :)

      The problem is in the way you load the xdebug extension. Xdebug cannot stop execution of the script unless it is loaded as a zend_extension.

      If zend_extension_ts does not work for you, did you try zend_extension ? Without _ts (thread safe) ... Although Xdebug site states that you need to use the _ts variant.

      Try to start apache without loading xdebug, open a phpinfo page and look for "Thread Safety". If it is "enabled" then you need _ts if it is not you need the one without.

      Not sore why it would crash... Perhaps try a different php version?

      A side note. I see that file mapping isn't working correctly, not sure why. If you have the latest version of the plugin, you can check "Bypass all mapping".

      Best regards.

      -Zobo

       
    • Hi zobo,

      thanks for your answer. My Zend is enabled. When I try only to activate the Zend part in the php.ini. That doesn't work and the Apache crashes if I run the PHP file with the phpinfo().

      Then I activated the normal extension, that doesn't work too. Then I activated both and it starts. I see in some pages debuginformations in the browser but nothing more.

      extension=php_xdebug-2.0.3-5.2.5.dll
      zend_extension_ts="d:\xampplite\php\ext\php_xdebug-2.0.3-5.2.5.dll"

      But it doesnt work again. Same with bypass activated.

      Accept: 127.0.0.1
      Recv: <?xml version="1.0" encoding="iso-8859-1"?>
      <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///D:/xampplite/htdocs/goldenangelcontest/index.php" language="PHP" protocol_version="1.0" appid="3188" idekey="test"><engine version="2.0.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2008 by Derick Rethans]]></copyright></init>
      Send: feature_set -i 1 -n max_depth -v 3
      Send: feature_set -i 2 -n max_children -v 15
      Send: breakpoint_set -i 3 -t line -f file:///C:\Users\aschmidt\AppData\Local\Temp\dbgp_file%253a%252f%252f%252fD%253a%252fxampplite%252fhtdocs%252fgoldenangelcontest%252fpasswort.php -n 8 -s enabled -h 0 -o >=
      Send: breakpoint_set -i 4 -t line -f file:///C:\Users\aschmidt\AppData\Local\Temp\dbgp_file%253a%252f%252f%252fD%253a%252fxampplite%252fhtdocs%252fgoldenangelcontest%252fpasswort.php -n 11 -s enabled -h 0 -o >=
      Send: breakpoint_list -i 5
      Send: step_into -i 6
      ----
      Recv: <?xml version="1.0" encoding="iso-8859-1"?>
      <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"></response>
      Recv: <?xml version="1.0" encoding="iso-8859-1"?>
      <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>
      Recv: <?xml version="1.0" encoding="iso-8859-1"?>
      <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="3" state="enabled" id="31880006"></response>
      Recv: <?xml version="1.0" encoding="iso-8859-1"?>
      <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4" state="enabled" id="31880007"></response>
      Recv: <?xml version="1.0" encoding="iso-8859-1"?>
      <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="5"><breakpoint type="line" filename="file:///C:/Users/aschmidt/AppData/Local/Temp/dbgp_file%253a%252f%252f%252fD%253a%252fxampplite%252fhtdocs%252fgoldenangelcontest%252fpasswort.php" lineno="11" state="enabled" hit_count="0" hit_condition="&gt;=" hit_value="0" id="31880007"></breakpoint><breakpoint type="line" filename="file:///C:/Users/aschmidt/AppData/Local/Temp/dbgp_file%253a%252f%252f%252fD%253a%252fxampplite%252fhtdocs%252fgoldenangelcontest%252fpasswort.php" lineno="8" state="enabled" hit_count="0" hit_condition="&gt;=" hit_value="0" id="31880006"></breakpoint></response>
      ----
      Recv: <?xml version="1.0" encoding="iso-8859-1"?>
      <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="6" status="stopping" reason="ok"></response>
      Send: run -i 7
      ----
      Disconnect: 127.0.0.1

      I really want to use a debugger in the local xampp... *wine*

       
      • Damjan Cvetko
        Damjan Cvetko
        2008-09-27

        Hi.

        Loading both won't work, because the first will load and the second will not - I think.
        And there is something else wrong with the local copy. Try to add this somewhere in your code:

        xdebug_break();

        It's an explicit breakpoint.

        Can you dump your PHPINFO? php.ini would also do good.

        Viel Glück!

        -Zobo

         
        • Damjan Cvetko
          Damjan Cvetko
          2008-09-27

          Hi. I decided to setup what you have and test it.
          You are right. Loading xdebug crashes the hell out of Apache. However, loading xdebug into CLI (php.exe) seems to work. I'll try to play around with it some more in the evening, but this is definitely something for the xdebug list.

          Re
          -Zobo

           
    • David Lidstone
      David Lidstone
      2009-05-26

      Was having exactly the issues described here. Thought I would post what worked for me, just in case anyone else is having similar problems.

      The xdebug dll supplied with my XAMPP (and referenced in the php.ini file) would load fine using 'extension=' but using just the 'zend_extension' method made my Apache crash.

      I finally found that downloading the latest Xdebug dll directly from the XDebug site and using that instead sorted out the problem, and allowed me to debug properly.

      BTW... Zobo, great work, but could you please place a link to this forum in your README.txt? Would have saved me a couple of days frustration! :-)

      Thanks, David

       
      • Damjan Cvetko
        Damjan Cvetko
        2009-05-26

        Great idea bout the link in Readme. I'll do that.

        Best,
        -Zobo

         
    • mike dee
      mike dee
      2009-07-17

      Just tried dbgp v0.0.11.20beta with np++5.3.1 unicode version and php_xdebug-2.0.5-5.2.dll on Apache/2.2.11 running PHP 5.2.9

      As before the line arrow and breakpoint balls are present but no stopping on breakpoints is still a problem. 

      Any news on a fix - or is this just me?  stopping on breakpoints was working fine in this config w/dbgp v0.1.10.18 but this version doesn't support the red ball/green arrow.

       
      • Damjan Cvetko
        Damjan Cvetko
        2009-07-20

        Sorry for the lack of updates.. Just a crazy busy time.
        Anyway, can you check the debug log if the breakpoints are set on the correct file names? Maybe its some internal xdebug change, or some bug in dbgp.

        Best,
        Zobo

         
        • mike dee
          mike dee
          2009-07-20

          can do - where in the filesystem does the log live?

           
          • Damjan Cvetko
            Damjan Cvetko
            2009-07-21

            Sorry, I confused you. The logging is in the window that the "DBG" button opens.

            Best,
            Zobo

             
            • mike dee
              mike dee
              2009-07-21

              I should have been able to figure out your log request, it seems I'm kind of rusty...

              yes, there are differences between the v10 and v11 versions in the params of the breakpoint_set cmd

              the v10 version outputs :

              Send: breakpoint_set -i 3 -t line -f file:///C:/Apache2/ims/trunk/templates/session/sessions.tpl -n 133 -s enabled -h 0 -o >=

              the v11 version outputs:

              Send: breakpoint_set -i 3 -t line -f C:\Apache2\ims/trunk/templates/session/sessions.tpl -n 133 -s enabled -h 0 -o >=

              in v11 the file uri is missing, the pathing directory separator changes between \ and /

              my map shows remote path and local path = C:\Apache2\

              While using v11 I changed remote/local path to C:/Apache2/

              breakpoint_set now shows:
              Send: breakpoint_set -i 3 -t line -f C:/Apache2/ims/trunk/templates/session/sessions.tpl -n 133 -s enabled -h 0 -o >=

              which is "more correct" but still missing the file uri and still has the no stop on breakpoint problem

              Then I tried debugging after checking the "Bypass all mapping" checkbox on in Plugins|DBGP|Config -- and that worked correctly by setting the breakpoint_set params to:

              Send: breakpoint_set -i 3 -t line -f file:///C:/Apache2/ims/trunk/templates/session/sessions.tpl -n 133 -s enabled -h 0 -o >=

              Green arrow and red ball visible, stopped at correct breakpoint.  This will work for me for now since most off of my debugging is on a local box - but any idea where the problem might lie?  I can see needing to debug remote at some point in the near future.

               
              • Damjan Cvetko
                Damjan Cvetko
                2009-07-22

                Hey. Nice catch. To be honest the mapping was rewritten in v11 and while I tested it as much as I could, I might have missed something. In case of debugging locally best option is to tick "Bypass all mapping". There were also some changes is Xdebug (not sure about the version anymore, tho) and this is why I decided to clean up the mapping code. What kind of remote debugging are you mostly doing, *nix or Windows? I'm quite sure I checked at least *nix mapping work. another hint: Always look at the URL in init dbgp message because it shows what kind of format Xdebug expects.

                Best,
                Zobo

                P.S.: Went to look at the code, and it should work if you put both local and remote with forward slashes. Strange indeed. I'll set myself a reminder to check it.

                 

  • Anonymous
    2011-09-21

    I was experiencing this issue and for me the solution was to tick the option "Bypass all mapping (local windows setup" in the DBGp configuration. In Notepad++ go to Plugins->DBGp->Config.. and the option is at the top.