为什么我的 Netbeans Xdebug 会话在一段时间不活动后会超时

发布于 2024-10-01 15:05:54 字数 400 浏览 0 评论 0原文

我喜欢 Netbeans 帮助我调试 Magento 应用程序的方式(在 Win 7 64 位上的 XAMPP 中),但我注意到连接在一段时间后似乎超时。断点不再被命中,我必须重新启动调试会话,这很烦人。关于如何延长或禁用调试超时有什么建议吗?

我在 IDE 或 Xdebug php.ini 配置中看不到任何选项。 Xdebug 文档指出:

当 URL 变量 XDEBUG_SESSION_START=名称已附加 对于 URL,Xdebug 会发出一个 cookie 名称“XDEBUG_SESSION”和值 XDEBUG_SESSION_START 的值 网址参数。期满时 cookie 是一小时。cookie 是一小时。

但不建议如何更改到期时间。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

清风不识月 2024-10-08 15:05:54

找到 php.ini 并将以下行添加到 xdebug 部分。

xdebug.remote_cookie_expire_time = 3600

该数字是 cookie 保持活动状态的时间(以秒为单位),默认为 3600(1 小时)。我将其设置为 36000(10 小时),效果很好,并鼓励我偶尔重新启动该进程以释放内存。如果你愿意,你可以将其设置为 0(无限制),尽管我发现这会导致各处出现奇怪的冻结。

请记住重新启动 Apache 以使更改生效。

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.

狠疯拽 2024-10-08 15:05:54

这可能与您的 Apache 配置有关。

可能的原因是配置的超时,它定义了如果没有任何反应,服务器在多长时间后结束进程......通常是有意义的,但在调试时,您可能只是忙于查看某些内容。

我的设置与你的有些不同,但也许我可以帮助你。

在 apache-folder /sites-available 中包含配置域相关虚拟主机的文件。在您的域和协议的标签中

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

在我的情况下增加了触发超时之前的可用时间段,从 40 秒增加到 120 秒。

然后(当然)重新启动你的apache。

也许这有帮助。

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.

强者自强 2024-10-08 15:05:54

我也有同样的问题。我通过更改 FcgidIOTimeout 而不是 IPCCommTimeout 解决了这个问题。

Linux 环境中:

查找:

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

结果:

/etc/apache2/someconfiguration:34:

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

找到这一行:

FcgidIOTimeout 45

< /IfModule>

添加/更改为:

FcgidIOTimeout {some time value you want: 3600}

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>

七禾 2024-10-08 15:05:54

对于那些使用 php-fpm 的用户,请尝试增加 php-fpm ini 文件中的 request_terminate_timeout 值。

For those who're using php-fpm try increasing value of request_terminate_timeout in your php-fpm ini file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文