Can't authenticate on mongodb with PHP

后端 未结 2 1161
Happy的楠姐
Happy的楠姐 2020-12-10 06:16

What i\'ve done:

Enabled authentication in /etc/mongod.conf :

auth = true

Created the first user from

相关标签:
2条回答
  • 2020-12-10 06:32

    Problem solved: apparenty it was caused by a problem/bug in the PHP mongo driver version 1.4

    I've upgraded the driver to version 1.6 with:

    pecl upgrade mongo
    

    and now the authentication works.

    0 讨论(0)
  • 2020-12-10 06:39

    I've had the same problem, in my case I've installed mongo using apt-get

    apt-get install php5-mongo
    

    And seems that Ubuntu repositories has still the version 1.4 and hasn't updated the package yet. If you want to install mongo on Ubuntu you should use the pecl option

    pecl install mongo
    

    Never use apt-get for installing mongo for php.

    0 讨论(0)
提交回复
热议问题