1

I use vim + xdebug to debug php. If the debug operation waste a long time, vim will lost the connection with xdebug, and I have to restart the debug by press F5 and do it from the first step again. So how can I set a longer time for the debug procedure?

2 Answers 2

3

The 5 second timeout is hard-coded in debugger.py. You can increase it by modifying the following line:

  def accept(self):
    print 'waiting for a new connection on port '+str(self.port)+' for 5 seconds...'
    serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    try:
      serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
      serv.bind(('', self.port))

      # Set a higher timeout here...
      serv.listen(5)
      (self.sock, address) = serv.accept()
    except socket.timeout:
      serv.close()
      self.stop()
      print 'timeout'
      return

In my plugin version, that happens to be line 556 of debugger.py. If your differs, just search in Vim for 5 or second.

Update:

Also found it at line 666

  def __init__(self, port = 9000, max_children = '32', max_data = '1024', max_depth = '1', minibufexpl = '0', debug = 0):
    """ initialize Debugger """

    # Probably need to increase here too...
    socket.setdefaulttimeout(5)
    self.port       = port
    self.debug      = debug
Sign up to request clarification or add additional context in comments.

1 Comment

That is not my issue.I guess the apache timeout setting results in this.Thank you for answering.
3

You can try my plugin - DBGPavim

http://www.vim.org/scripts/script.php?script_id=4059

DBGPavim does not have such limitation, so that VIM users do not need to wait for connection from apache server. No timeout things, users press F5 to start debugger backend, and uses his/her VIM normally. Debug backend won't stop users to interact with VIM. Users can press F6 to stop debugger backend anytime.

1 Comment

+1 for awesome plugin. It took me some time to figure out how to set it up... because it's so much more simple than DGBp. I love the fact that it's just easy to parameter using Virtualhost directives and hence not relying on global php.ini parameters (useful if you happen to host PROD and DEV on the same server)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.