有时会出现错误(~30%):
Failed to connect to: IP:2333: Read timed out after reading 0 bytes, waited for 0.000000 seconds
在所有情况下。这是什么?
最佳答案
我有完全相同的错误。解决方案是为您的请求设置超时。
$cursor->timeout(-1);
在每个光标上。 MongoCursor::$timeout = -1;
在您的索引/连接文件中。 -1 是设置无限超时。如果您不想要无限,您也可以以毫秒为单位设置一个值。
关于mongodb-php - PHP MongoDB fatal error : Read timed out,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17577133/