Can't connect to MongoDB through PHP

2020-03-09 09:10发布

I just wanted to take a look at Mongo-DB. But i just don't get it running. I've installed it with PECL and my phpinfo() tells me that the extension is loaded, but when i try to get a connection with

$mongo = new Mongo();

I get this:

Fatal error: Uncaught exception 'MongoConnectionException' with message ': Transport endpoint is not connected'

Anybody have the same Problem? ... Or any Idea on this?

7条回答
姐就是有狂的资本
2楼-- · 2020-03-09 09:36

Please don't take this the wrong way, but have you actually got the server running? Only it looks like your error relates to a failure to connect and you've made no mention of the server or where it is located (localhost on the default port for example)

查看更多
登录 后发表回答