Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my Netbeans Xdebug session timeout after period of inactivity

I love the way the Netbeans helps me to debug my Magento applications (in XAMPP on Win 7 64-bit), but I've noticed that the connection seems to timeout after a period. The breakpoints no longer get hit and I have to restart the debugging session which is annoying. Any suggestions for how to extend or disable the debug timeout?

I can't see any options in the IDE or Xdebug php.ini config. The Xdebug documentation states:

When the URL variable XDEBUG_SESSION_START=name is appended to an URL, Xdebug emits a cookie with the name "XDEBUG_SESSION" and as value the value of the XDEBUG_SESSION_START URL parameter. The expiry of the cookie is one hour.cookie is one hour.

but doesn't suggest how to change the expiry time.

like image 614
Jonathan Day Avatar asked Nov 09 '10 23:11

Jonathan Day


3 Answers

Find php.ini and add the following line to the xdebug section.

xdebug.remote_cookie_expire_time = 3600

The number is the time in seconds for the cookie to remain active, which defaults to 3600 (1 hour). I set it to 36000 (10 hours), which works fine and encourages me to restart the process occasionally to free memory. You can set it to 0 (unlimited) if you want, although I found that caused odd freezes here and there.

Remember to restart Apache for the change to kick in.

like image 154
Matt Gibson Avatar answered Nov 19 '22 14:11

Matt Gibson


This is probably related to your Apache-Configuration.

The probable cause is a configured timeout that defines after what period of time the server ends the process if nothing happens ... makes sense usually, but when debugging you might be just busy taking a look at something.

My setup is somewhat different from yours but maybe I can help you.

In the apache-folder /sites-available are located the files that configure your domain-related virtual hosts. Within the -Tags of your Domain and protocol I put

<IfModule mod_fcgid.c>
     AddHandler fcgid-script .fcgi
     IdleTimeout 300
     IPCConnectTimeout 20
     IPCCommTimeout 120
     IdleScanInterval 120
</IfModule>

That increased in my case the available period of time until the timeout would be triggered from 40 to 120 seconds.

Then (of course) restart your apache.

Maybe that helps.

like image 39
Raffael Avatar answered Nov 19 '22 14:11

Raffael


I had the same problem. I solved it by changing FcgidIOTimeout instead of IPCCommTimeout.

In a Linux environment:

find :

sudo grep -rnw '/etc' -e 'IfModule mod_fcgid.c'

Result:

/etc/apache2/someconfiguration:34:

/etc/apache2/mods-available/fcgid.conf:1:

Find this line:

<IfModule mod_fcgid.c>

FcgidIOTimeout 45

</IfModule>

Add/change to:

<IfModule mod_fcgid.c>

FcgidIOTimeout {some time value you want: 3600}

</IfModule>

like image 30
Haki Dere Avatar answered Nov 19 '22 12:11

Haki Dere