从 PHP 读取 apache 连接超时

发布于 2024-10-08 03:07:37 字数 236 浏览 0 评论 0原文

我遇到了一些麻烦,并在 $_SERVER$_SESSION 变量中搜索解决方案,但找不到它。然而,在phpinfo()中我发现Timeouts Connection: 300 - Keep-Alive: 15

假设这就是我正在搜索的内容(apache 关闭连接之前不活动的秒数),还有其他方法可以读取它吗?

谢谢。

I'm having some trouble and searched for the solution in the $_SERVER and $_SESSION variables, but couldn't find it. However, in the phpinfo() i found Timeouts Connection: 300 - Keep-Alive: 15.

Asuming that is what i am searching for (the number of seconds of inactivity before apache closes the connection), is there any other way of reading it?

Thanks.

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

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

发布评论

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

评论(2

耳根太软 2024-10-15 03:07:37

请参阅 apache_response_headers 函数,以及还有随附的评论。

这对我有用:

<?php

flush();
$apache_headers = apache_response_headers();
//echo '<pre>' . print_r($apache_headers, true) . '</pre>';
preg_match('/timeout=(\d+)/', $apache_headers['Keep-Alive'], $matches);
echo $matches[1];

?>

See the apache_response_headers function, and also the accompanying comments.

This works for me:

<?php

flush();
$apache_headers = apache_response_headers();
//echo '<pre>' . print_r($apache_headers, true) . '</pre>';
preg_match('/timeout=(\d+)/', $apache_headers['Keep-Alive'], $matches);
echo $matches[1];

?>
淤浪 2024-10-15 03:07:37

存在用于读取和写入 php.INI 值的函数 ini_get、ini_set

there exist funcitons ini_get, ini_set for reading and writing php.INI values

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