Uncaught exception 'MongoConnectionException' with message 'Unknown error' in...
$mongo = new Mongo();
执行时,报错:"Uncaught exception 'MongoConnectionException' with message 'Unknown error' in..."
?
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)
原因:连接错误,检查服务端是否运行?连接url是否正确?
new Mongo()(默认连接本机的27017端口)
?
建一个DB文件夹来存放数据库文件路径 路径d:\DB\data
?
保持此窗口为开启状态,重新执行php代码程序,就可以正确执行了