How do you figure out what causes the debugger to 'Disconnect'

os:kubunt 10.04
PhpStorm 2.0.1
Build PS:103.243

My debugger is working on a remote machine using xdebug.

Most of the time it will work fine.  Stepping through code until i click the green arrow (or F9) to let it run through.

But _sometimes_ it doesnt want to play nice.

_sometimes_ if i hover over a variable to see what it contains it will drop to "Disconnected" state. OR
_sometimes_ if i try to right click on a variable to "Add to Watches" it will drop to "Disconnected" and popup a "Download index.php" dialog in the browser.
_sometimes_ it will be fine, checking variables by hover and adding them to the watch list, then enter another level of depth by going into a function and Bam! "Disconnected."

It doesnt seam very stable or consistant in what it does either.  some days are good, some days are bad.

How do i figure out what causes it?

4 comments
Comment actions Permalink

Hi michael,

I know these 2 possible reasons (excluding the PhpStorm, which may contain some bugs in this area):

1) timeout issue (low possibility) -- this really depends on your web server software (if script is running too long or provides no output into a response buffer (the web page content), the webserver may decide to abort such "hanged" script), so please if there are any settings that may affect such behavior.

2) a bug in xdebug / xdebug stability -- Try xdebug v2.1.1 stable -- released less than 2 weeks ago: http://xdebug.org/updates.php

If you can -- try Zend Debugger -- it may not have these issues (some people finding it more stable than xdebug).


I have met both of the reasons in the past (using Windows on dev and production).
1) The "timeout" is definitely an issue for me when debugging under IIS v7 (that is the way how IIS runs FastCGI) -- setting 600 secs instead of default 30 secs solves it for me (600 secs = 10 mins = enough time for a single debug session). On another hand, I don't really have such issue when debugged under Apache (non-FastCGI mode).

2) I personally find debugging with xdebug much more stable under IIS compared to Apache. For some reason (possibly because of my bad settings) Apache just hangs when error occurs in DB component (SQL Server native driver, ODBC driver or even MySQL). For example, when debugging an error in SQL query (non-existing field or table) --- under Apache it logs an error and hangs (browser will show blank page) while under IIS error is logged and I still can continue to debug (browser will show app-handled error page)...

I have not tried Zend Debugger myself yet.

0
Comment actions Permalink

Thanks Andriy,

Im sure i havent upgraded xdebug within the last two weeks, so that can be the first thing I try.

I have no experience with windows servers and only have a linux one here, so will have to stay with that.

You have given me a lot of things to go look at, hopefully i can get it stable.

Cheers.

--   edit   --
I just did the upgrade to xdebug 2.1.1 and gave all the timeout settings an extra zero on the end of them.  Ran through a pattern that was disconnecting yesterday and it didnt disconnect today.  Hopefully that means its fixed and its not just "Having a good day".

Thanks again Andriy

0
Comment actions Permalink

Andriy,

Thank you!:)

0
Comment actions Permalink

michael,

In most cases it is an xdebug issue and upgrade to the latest stable version can solve this.
If you meet this issue again(on xdebug 2.1.1), please try to reproduce the problem and attach xdebug log(see xdebug.remote_log at http://xdebug.org/docs/remote).

Thank you for feedback!

0

Please sign in to leave a comment.