我想从php 5.4迁移到php 7.0 当我在php 7上测试我的代码时,我有时(并不总是)有问题 - 消息:MongoDB \ Driver \ Manager :: executeQuery():发送58个字节失败,错误为errno = 10054
当我使用php v5时,我没有遇到这个问题。请帮帮我。
代码php7
self::$Db = new MongoDB\Driver\Manager('mongodb://login:pass3@ip:port/db');
$params = ['name'=>'test'];
$query = new MongoDB\Driver\Query($params, [ ]);
var_dump(self::$Db->executeQuery('db.collection', $query)->toArray());
代码php5
self::$Db = new MongoClient('mongodb://ip', [
'username' => 'user',
'password' => 'pass',
'db' => 'DB'
]);
$coll = self::$Db->collection;
var_dump($coll->findOne(['name'=>'test']));