无法通过PHP连接到MongoDB [英] Can't connect to MongoDB through PHP

查看:65
本文介绍了无法通过PHP连接到MongoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想看一下Mongo-DB.但我只是不让它运行.我已经用PECL安装了它,我的phpinfo()告诉我扩展已加载,但是当我尝试与之建立连接时

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();

我明白了:

致命错误:未捕获的异常'MongoConnectionException'与 消息:传输端点未连接"

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

有人有同样的问题吗? ...或对此有任何想法?

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

推荐答案

请不要采用这种错误的方式,但是实际上您已在运行服务器吗?只是看起来您的错误与连接失败有关,并且您没有提及服务器或服务器的位置(例如,默认端口上的localhost)

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)

这篇关于无法通过PHP连接到MongoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆