PHP/MongoDB 错误:未捕获异常“MongoCursorException”
所以我使用 MongoLab 作为我的数据库主机,最近我遇到了这个问题。每当我第一次加载应用程序并在第一次运行时清除缓存时,我都会收到以下错误消息:
致命错误:未捕获带有消息的异常“MongoCursorException” “无法发送查询:连接已被对等方重置”
在我再次刷新页面并且应用程序加载时没有任何问题。我想知道是否有人知道此错误的原因或有任何解决方案来解决此问题。
谢谢,节日快乐。
So i'm using MongoLab as my DB Host and recently I have been running into this issue. Whenever I load up my application for the first time with a cleared cache on the first run, I receive this error message:
Fatal error: Uncaught exception 'MongoCursorException' with message
'couldn't send query: Connection reset by peer'
After I refresh the page again and the application loads without any issues. I was wondering if anyone knew the reason for this error or had any fixes to resolve this.
Thanks and Happy Holidays.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在哪里托管您的应用程序代码?
可能发生的情况是,第一个连接需要一段时间(比设置的超时时间长)才能连接到 MongoLab 主机。然后建立连接,以便第二个请求使用它。
Where are you hosting your app code?
What is likely happening is that the first connection is taking a while (longer than the set timeout) to connect to the MongoLab host. The connection is then established so that the second request uses it.