Menu

How to debug a specific URL ??

2007-03-01
2013-04-17
  • Patrick Allaert

    Patrick Allaert - 2007-03-01

    How is it possible in PE (or in kate) to debug a specific URL when all URL's are 'catched' by a single PHP file as in lots of MVC framework (e.g. Zend Framework).

    For example:
    http://example.org/news/
    http://example.org/article/edit/1234

    are both redirected to an index.php file.

    Using "/article/edit/1234" in the "Arguments" field and starting the debugging will open Konqueror with: http://example.org/index.php?XDEBUG_SESSION_START=123456789&/article/edit/1234 which is wrong of course.

    My site is configured as being "http://example.org/" and I tried to play with the "Default file" setting (set to index.php) but without success.

    Please, don't tell me that I have to configure one site for every URL :-S I am certainly missing something...

    For the 4th time, I am switching to Zend Studio just because I don't know how to do this. I hate asking dummy questions like this one but here I really don't know...

    Thanks for your help !
    Patrick

     
    • Thiago Silva

      Thiago Silva - 2007-03-01

      Well, usually I use JIT to do this. There are two ways to start a debug session:
      -Starting through PE
      -Starting through the browser

      When you start the debug session through PE, it uses the info in the Site settings and "Arguments" field to construct an URL and make an HTTP request to the server (using your browser or not, according to your settings). Only then, your debugger (ie Xdebug) will notify PE and start conversation.

      Starting debug through the browser is loading yourself the desired URL in your browser with a specific argument (that depends on your debugger). I see that you are using Xdebug, so all you have to do is add the XDEBUG_SESSION_START arg in the URL. Then again, the debugger will notify PE and start conversation. For instance, loading in your browser

      http://example.org/article/edit/1234?XDEBUG_SESSION_START=123456789

      should do what you want.

      So, if you are using mod_rewrite (or something similar) to debug URLs such as "/article/1234", there is no easy way (if there is one at all) to start debugging through PE. Only loading the URL in the browser manually. Also, try "break on load" in the settings as well, so it pauses execution whenever debugging starts.

       
    • Patrick Allaert

      Patrick Allaert - 2007-03-02

      My God! It was that simple :S => JIT...

      I absolutely didn't know what this option was used for and did never see any hint about this one. Is this possible to have something a little bit more descriptive than just a "JIT" checkbox. It would be great for people that never met this acronym before. Well, "Just In Time debugging" is not really descriptive too (marketing terminology invented by M$?)... Something like "Listen for debug session" maybe?

      Anyway, thanks *A LOT* for your quick reply :)
      Patrick

       
      • Thiago Silva

        Thiago Silva - 2007-03-02

        I guess Protoeditor has a little problem with documentation...
        That is something that will have to wait. So the best I can do is reply to questions as I see them :)

        Thiago

         

Log in to post a comment.

MongoDB Logo MongoDB