Mongo报如下类似错误时的修改方法Cannot natively represent the long 1396367483000 on this platform

今天通过php连接mongodb,并读取数据时,其中一个字段为: "createTime":NumberLong("1397524645000"),由于太长,一直报如下的错误:

Cannot natively represent the long 1396367483000 on this platform

在国内的网站上查了好长时间,给出的解决方法都是添加:ini_set('mongo.native_long', 1);,结果根本不好使。后来还是通过google查到了解决方法,添加:ini_set('mongo.long_as_object', 1);而不是ini_set('mongo.native_long', 1);。

原文地址:https://www.cnblogs.com/kangshuai/p/5012014.html