Why is my Netbeans Xdebug session timeout after a period of inactivity

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

I do not see any parameters in the IDE or Xdebug php.ini configuration. The Xdebug documentation says:

When the URL variable is added XDEBUG_SESSION_START = URL name, Xdebug emits a cookie with the name "XDEBUG_SESSION" and the value value is XDEBUG_SESSION_START URL. Cookie expiration is one hour. Cookies are one hour.

but does not propose changing the expiration time.

+8
debugging php timeout xampp netbeans
source share
3 answers

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

xdebug.remote_cookie_expire_time = 3600 

The number is the time in seconds that the cookie remains active, by default 3600 (1 hour). I set it to 36000 (10 hours), which works fine and prompts me to periodically restart the process to free up memory. You can set it to 0 (no limit) if you want, although I found that it caused odd hangs here and there.

Remember to restart Apache for the change you need to make.

+15
source share

This is probably due to your Apache configuration.

The likely reason is the configured timeout, which determines how long the server will complete the process if nothing happens ... it usually makes sense, but when debugging, you can just take a look at something.

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

The apache / sites-available folder contains files that configure your virtual hosts associated with the domain. Inside -Tags your domain and protocol I enter

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

This increased in my case the available period of time until the timeout is started from 40 to 120 seconds.

Then (of course) restart apache.

Maybe this helps.

+7
source share

For those using php-fpm, try increasing the value of request_terminate_timeout in your php-fpm ini file.

0
source share

All Articles