Can't authenticate on mongodb with PHP

泪湿孤枕 提交于 2019-11-29 04:12:03

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.

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.

according to mongo installation instructions in windows versions the mongo.dll must copy to system path e.g. c:\windows. i tested that and yes it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!