debugging PHP code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • knellim
    New Member
    • Feb 2010
    • 23

    debugging PHP code

    Hello All,
    I am trying to test a PHP web application. I have installed Eclipse on a Centos machine. I am running a Apache web server.
    The problem I am facing is that the code has exit commands at few places and whenever I am debugging the code and the exit command is encountered, the debugging stops. I want restart my debugging from the point I left with POST values.
    Can anyone pls help my how to debug the code in these scenarios.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    so while your debugging you don't want the code todo what it's suppose it?

    Why can't you just comment out the exit calls? or the condition that leads to them?




    Dan

    Comment

    • knellim
      New Member
      • Feb 2010
      • 23

      #3
      The problem is in my web application, there is a main page index.php. So every time this page gets loaded/refreshed based on a variable $mode which is passed as GET parameter. After every page load, the database is disconnected and exit is done.
      So, initially, this page gets loaded as login page. It waits for username,passwo rd sent as POST data.
      The thing is even if I comment out exit, the next pages(ie -pages after login page) are not debugged. I mean i cant see the debugger hitting any line of code after I press Login button in Login form.

      I am not sure as how event handling is done and debugging of web pages is done in PHP. So, I am basically not able to understand this!

      Please help! Its very important! let me know if any input!

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        I am not familiar with Eclipse,
        but you can debug yourself by simply running the script in a browser after adding simple echo statements to output variable and $_POST values.

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Not really understanding OP's question. Anyhoo, check out xdebug.

          Comment

          Working...