For me, the only thing that worked:
ini_set('mongo.long_as_object', 1);
Hope this saves you some time. This is one of those stupid things that make you think: "Why the hell did I become a programmer?"
EDIT: driver from http://pecl.php.net/package/mongo helped me. I downloaded the latest driver. Test your version with the phpinfo () command. For instance. for me, on 64-bit Win7 this is:
PHP Version 5.5.12 PHP Extension Build: API20121212,TS,VC11
Pay attention to the line "TS, VC11". This means that Thread Thread, but your version may be unsafe (NTS).
So, I downloaded 64bit, TS for PHP 5.5. I ran into this problem for a long time, and finally, the correct driver solved this problem.
source share