Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #7064
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Problem with PHP Driver Authentication |
| Date | 2012-09-14 10:21 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <k2vegs$iu0$1@dont-email.me> (permalink) |
| References | <770f2476-60e7-485a-a6d7-9a2dfc6d2325@googlegroups.com> |
On 9/14/2012 4:20 AM, picc09@gmail.com wrote:
> 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@127.0.0.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.
>
Did you ask in Mongo support? They know their code better than anyone else.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
Problem with PHP Driver Authentication picc09@gmail.com - 2012-09-14 01:20 -0700 Re: Problem with PHP Driver Authentication Jerry Stuckle <jstucklex@attglobal.net> - 2012-09-14 10:21 -0400
csiph-web