Can't connect to MongoDB through PHP

mr.alex picture mr.alex · Jan 31, 2010 · Viewed 16.4k times · Source

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?

Answer

Mark Embling picture Mark Embling · Feb 1, 2010

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)