为什么 error_log() 总是发送 3 封电子邮件?
我使用 error_log() 函数,如下所示:
error_log($errorstring, 1, '[email protected]');
它工作正常,但每次执行时,我都会收到同一封电子邮件的 3 个副本,间隔大约 1 或 2 秒。没有循环或它所在的任何东西,这只是为了通知我登录尝试失败,所以它在 die() 之前只被调用一次。
有人对此有什么好主意吗?
编辑:抱歉忘记提及,这是在 PHP 中使用 error_log() 函数。
EDIT2:我已切换为使用此处找到的自定义错误处理程序:
http://www.tonymarston .net/php-mysql/errorhandler.html
我发现,虽然 MySQL 错误仅按预期生成一封电子邮件,但非 MySQL 错误却生成三封电子邮件。它始终是三个...永远不会多或少,并且它们之间的间隔为 0 到 2 秒,具体取决于电子邮件中发送的时间戳。
任何人都有其他想法为什么会发生这种情况?
I'm using the error_log() function like so:
error_log($errorstring, 1, '[email protected]');
And it works fine, but every single time it is executed I get exactly 3 copies of the same email spaced about 1 or 2 seconds apart. There is no loop or anything that it's in, this is simply to notify me of a failed login attempt, so it is only called once before it die()s.
Anyone have any bright ideas on this?
EDIT: Sorry forgot to mention, this is in PHP using the error_log() function.
EDIT2: I have switched to using the custom error handler found here:
http://www.tonymarston.net/php-mysql/errorhandler.html
What I have discovered is that while MySQL errors generate only a single email as intended, non-MySQL errors generate the three emails. It's always three... never more or less, and they are spaced anywhere from 0 to 2 seconds apart, based on the timestamp sent in the emails.
Anyone have any other ideas why in the world this would be happening??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PHP MANUAL
1
消息已发送通过电子邮件发送到目标参数中的地址。这是唯一使用第四个参数
extra_headers 的消息类型。extra_headers
额外的标头。当
message_type
参数设置为1
时使用它。此消息类型使用与 mail() 相同的内部函数。PHP MANUAL
1
message is sent by email to the address in the destination parameter. This is the only message type where thefourth parameter
, extra_headers is used.extra_headers
The extra headers. It's used when the
message_type
parameter is set to1
. This message type uses the same internal function as mail() does.