Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RockMongo fatal error

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.

like image 648
Ramakrishna Avatar asked Apr 09 '14 12:04

Ramakrishna


3 Answers

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.

like image 141
gog Avatar answered Sep 25 '22 13:09

gog


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

like image 42
TecHunter Avatar answered Sep 23 '22 13:09

TecHunter


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.

like image 45
Stas Slabko Avatar answered Sep 22 '22 13:09

Stas Slabko