Open GoogleCodeExporter opened 9 years ago
This worked for me (after studying rockmongo source code):
// ./config.php
$MONGO["servers"][$i]["mongo_auth"] = false;
$MONGO["servers"][$i]["control_auth"] = false;
$MONGO["servers"][$i]["mongo_name"] = "Your host name";
$MONGO["servers"][$i]["mongo_host"] = "your.host.com"; // or IP address (eg
localhost: 127.0.0.1)
$MONGO["servers"][$i]["mongo_port"] = "27017"; // or any other port
$MONGO["servers"][$i]["mongo_db"] = "your_db_name"; // default "admin"
$MONGO["servers"][$i]["mongo_user"] = "your_username";
$MONGO["servers"][$i]["mongo_pass"] = "your_password";
In case of no success try debugging ./app/models/MServer#auth() method (look
for user/pass values passed).
Good luck!
Original comment by stankovi...@gmail.com
on 18 Nov 2012 at 11:31
same problem with :
MongoDB 2.2.1
PHP 5.2.17
php_mongo 1.3.0
Original comment by ghislain...@gmail.com
on 29 Nov 2012 at 9:18
Indeed the authenticate method is deprecated with new driver (1.3)
Authentication has to be inserted in the connection string.
Ex : mongodb://username:password@host:port
Original comment by thomas.r...@gmail.com
on 29 Nov 2012 at 9:52
My setup:
Ubuntu 12.04
PHP 5.3.17
MongoDB 2.2.2 (from the official PPA)
PHP mongo driver 1.3.0 (from PECL)
RockMongo 1.1.3
I think the issue has to do with the RockMongo script not working with the 1.3
series of the PHP mongo driver. I ran into this same issue when I updated my
development machine from 1.2.12 to 1.3.0 of the driver and I was no longer able
to login to the server with RockMongo.
I have a separate laptop that also has RockMongo 1.1.3, PHP 5.3.17, MongoDB
2.2.2, and the PHP mongo driver. Except on my laptop I am still on the 1.2.12
version of the mongo driver and I am able to login with RockMongo and edit my
databases as it should.
Original comment by tegskywa...@gmail.com
on 29 Nov 2012 at 4:33
$server = $this->_mongoHost . ":" . $this->_mongoPort;
if (!$this->_mongoPort) {
$server = $this->_mongoHost;
}
if ($this->_mongoAuth) $server = 'mongodb://' . $username . ':' . $password .
'@' . $server . '/' . $db;
try {
$this->_mongo = new Mongo($server, $this->_mongoOptions);
$this->_mongo->setSlaveOkay(true);
}
catch(Exception $e) {
echo "Unable to connect MongoDB, please check your configurations. MongoDB said:" . $e->getMessage() . ".";
exit();
}
// changing timeout to the new value
MongoCursor::$timeout = $this->_mongoTimeout;
if ($this->_mongoAuth) return $this->_mongo;
//auth by rock
else if ($this->_controlAuth) {
if (!isset($this->_controlUsers[$username]) || $this->_controlUsers[$username] != $password) {
return false;
}
Issue is in the "models/MServer.php" code inside the auth() function.
Original comment by nicho...@hellohunter.com
on 30 Nov 2012 at 8:22
So I fixed it with the removal of a block of code and the addition of two
lines. Now everything works properly. See my code changes above. The lines
that aren't tabbed in are the new ones.
Original comment by nicho...@hellohunter.com
on 30 Nov 2012 at 8:23
Your fix for the MServer.php file worked. Be sure to get in contact with the
maintainer of the project about your fix so he can put in a newer RockMongo as
soon as possible. Will this code change also work with the 1.2 series of the
PHP mongo extension? If so, he can release a new version that covers both the
old and new versions of the PECL extension without having to put in extra code
to check for versions and then apply the new code or keep the old.
Original comment by tegskywa...@gmail.com
on 30 Nov 2012 at 5:17
how should the config look when applying the MServer fix above?
Original comment by sc...@mtrlog.com
on 30 Nov 2012 at 6:03
Sorry all, but what should I specifically to change to patch this problem? I'd
definitely loving see this fixes as soon as possible.
Original comment by jaakko.t...@gmail.com
on 8 Dec 2012 at 1:13
Hi, i am RockMongo maintainer, In fact, wen i try to connect MongoDB (mongo
1.3.0) using "mongodb://username:password@host/db", my web server will be
crashed, mongo driver should be a bug.
Original comment by iwind....@gmail.com
on 13 Dec 2012 at 10:07
There are too many segfault issue in MongoDB php driver after 1.3.0, so every
one is not encouraged to this version.
Original comment by iwind....@gmail.com
on 13 Dec 2012 at 10:21
http://pecl.php.net/package-changelog.php?package=mongo
Original comment by iwind....@gmail.com
on 13 Dec 2012 at 10:24
Original issue reported on code.google.com by
scottada...@gmail.com
on 25 Oct 2012 at 1:44