RockMongo fatal error
Asked Answered
B

3

5

I have installed rockmongo in my ubuntu from this site.When I tried to open the rockmongo from browser it showing fatal error as like mentioned below.

Error:

Fatal error: ini_set(): To prevent data corruption, you are not allowed to turn on the mongo.native_long setting on 32-bit platforms in Unknown on line 0

How can i resolve this issue,can anyone give me a solution for this issue.

Bobbery answered 9/4, 2014 at 12:22 Comment(0)
H
12

native_long support for 32-bits has been (quite logically) removed from the mongo driver. . RockMongo uses ini_set("mongo.native_long", 1); in its index.php. As a quick fix, comment this line out.

Haemolysin answered 9/4, 2014 at 12:31 Comment(1)
Thank you Georg,I made a quick fix.Bobbery
M
4

The quick fix is here, in index.php replace the ini_set line :

ini_set("mongo.native_long", 1);

with:

ini_set('mongo.native_long', strlen(decbin(~0)) == 32 ? 0 : 1);

Or just remove it, the default value is 1 anyway

Mouthwatering answered 10/7, 2014 at 12:53 Comment(0)
C
1

In my configuration

Windows 7, Apache 2, PHP 5.5 [API220121212,TS,VC11], Mongo 2.6, Mongo PHP extension 1.5.7

only the combination of

ini_set("mongo.native_long", 0);
ini_set("mongo.long_as_object", 1);

helped to recover from the "Cannot natively represent the long 9223372036854775807 on this platform" error.

Coplanar answered 6/10, 2015 at 18:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.