如何修复php中的网关超时错误?

发布于 2024-09-05 21:00:32 字数 379 浏览 3 评论 0原文

我有一个 php 文件,可以在移动设备上向数据库特定表中的所有用户发送短信。 现在参赛作品数量大约有2000个左右,并且这个数字还会继续增加。 在我的页面上有一个小表单,可以从下拉列表中选择要向其发送消息的用户列表,然后用户在文本区域中写入要发送的文本,然后单击提交按钮,php 脚本星发送向手机号码发送消息。

现在,在尝试发送消息时,我的浏览器显示网关超时错误,但脚本继续运行,并且消息被发送到手机,但不是一次,而是 6 次。 我检查了我的脚本和查询,所有代码都是正确的。这一切都是由于网关超时而发生的。

现在,这个网关超时是否会使脚本一次又一次地运行,直到浏览器未关闭为止?这就是同一条消息被发送 6 次到手机号码的原因吗? 我的意思是我怎样才能避免我的文件出现此网关错误,以便一条消息只发送一次到一个号码?

Iam having a php file that sends text messages on mobile to all the users that i have in my database's particular table.
Now the entries are like 2000 or so in number and this number will keep on increasing.
On my page there is a small form that selects a list of the users to whom message is to be sent from a drop down and then user writes the text to be sent in a textarea and then on clicking the submit button php script stars sending the messages to mobile numbers.

Now while trying to send messages my browser has shown gateway timeout error but the script kept on running and messages are sent to the mobiles but not once but 6 times.
I checked my script my query and all the code is correct.This all happened coz of that gateway timeout.

Now does this gateway timeout kepts the script running again and again till the browser is not closed?? is this was the reason that a single message was sent 6 times to mobile numbers??
I mean how can i escape my file from getting this gateway error so that one message is sent only one time to a number??

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

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

发布评论

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

评论(1

行至春深 2024-09-12 21:00:32

如何修复 php 中的网关超时错误???

您不能在您和脚本运行位置之间报告错误。

您可以通过独立于浏览器请求运行 PHP 脚本来解决该问题:在 google 上搜索长时间运行的 PHP 进程或阅读 这个

C.

how to fix gateway timeout error in php???

You can't that error is being reported by something in between you and where the script is running.

You can work around the problem by running the PHP script independently of the browser request: Go have a google for long running PHP processes or read this

C.

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