FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Problem with PHP Driver Authentication
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Problem with PHP Driver Authentication [message #179128] Fri, 14 September 2012 08:20 Go to previous message
picc09 is currently offline  picc09
Messages: 1
Registered: September 2012
Karma:
Junior Member
Hi,
I have a problem in the mongo's config on my computer that I use for local test.

-- mongodb.conf --
dbpath = /path/to/data
logpath = /path/to/mongo.log
logappend = true
auth = true

-- startup command --
sudo mongod -f /path/to/mongodb.conf --fork

I also tried:

sudo mongod -f /path/to/mongodb.conf --fork --auth

-- computer installation --
OSX 10.7.4
PHP 5.3.14 (ZendServerCE 5.6)
Mongo 2.2.0
PHP Mongo Driver: 1.2.12

-- php file that works but deprecated --
$mongo = new Mongo('mongodb://127.0.0.1:27017');
$db = $mongo->db_name;
$db->authenticate('user','pass');

-- new version of the code that does not work --
$mongo = new Mongo('mongodb://user:pass(at)127(dot)0(dot)0(dot)1:27017/db_name');
$db = $mongo->db_name;

throws exception:

MongoConnectionException: Couldn't authenticate with database db_name: username [user] in ...

Why?
What's wrong?
MongoHub working properly, mongo console is working properly, why PHP throws an exception?

Thanks in advance!

A.
[Message index]
 
Read Message
Read Message
Previous Topic: Never log deprecation warnings
Next Topic: log of all php's connection
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 14:09:04 GMT 2024

Total time taken to generate the page: 0.04162 seconds