Can#39;t connect to MongoDB through PHP(无法通过 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法通过 PHP 连接到 MongoDB
基础教程推荐
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
