I used the following PHP code to connect to MongoDB:
$m = new MongoClient("mongodb://localhost:27017");
However, I get the following error:
Fatal error: Failed to throw "MongoConnectionException" with the message "Could not connect to: localhost: 27017: Unknown error"
I have tried many connection string features that are hosted on different blogs; nothing helps. Does anyone have any ideas?
source share