运行 PHP 脚本时什么会导致连接重置?

发布于 2024-09-02 18:16:51 字数 261 浏览 2 评论 0原文

我使用 CodeIgniter 开发了一个 Web 应用程序,它可以在我的本地计算机(一台使用 Windows,一台使用 Linux)上完美运行。当我将其移至我的托管服务器时,当运行一个特定的 PHP 脚本(该脚本对数组执行一些 MySQL 查询和一些操作)时,连接会重置。我查询的数据很小,只有几张表,最多25条记录。 Firefox 可能会在 2-3 秒后返回“连接已重置”。我检查了服务器错误日志,但那里什么也没有。 不幸的是我无法访问 Apache 错误日志。

什么会导致这种行为?

I've developed a web application with CodeIgniter that works perfectly on my local machines (one with windows and one with Linux). When I moved it to my hosting server, connection gets reset when running one particular PHP script that does a few MySQL queries and some operations on arrays. The data I'm querying is small, just a few tables with up to 25 records. Firefox returns "The connection was reset" after maybe 2-3 seconds. I checked the servers error logs but there was nothing there.
Unfortunately I don't have access to Apache error logs.

What can cause this behavior?

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

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

发布评论

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

评论(2

可遇━不可求 2024-09-09 18:16:51

您的脚本执行时间是否可能超过 PHP 配置允许的时间。诚然,2-3 秒看起来相当短,但它可能会被令人讨厌的托管提供商荒谬地限制。如果我记得的话,PHP 的默认值是 30 秒。

Is it possible that your script is executing for longer than PHP has been configured to allow. Admittedly, 2-3 seconds seems rather short, but it could be absurdly limited by a nasty hosting provider. The default for PHP is 30 seconds if I remember.

十雾 2024-09-09 18:16:51

正如 @marcin_koss 所描述的,这同样适用于我。
我必须停用 code-igniter Session 类并使用本机 PHP 会话。

session_start();
$_SESSION[]

as described by @marcin_koss , same applied to me.
I had to deactivate the code-igniter Session class and use the native PHP session.

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