使用 MongoHQ 和 PHPFog

发布于 2024-11-15 15:03:27 字数 104 浏览 6 评论 0原文

这里是新手。我很困惑。我想知道如何通过 MongoHQ 将 MongoDB 与 PHPFog 上托管的应用程序一起使用。 Phpfog 使用 Github 将提交推送到您的基本文件夹中。谢谢你!

newbie here. I m confused. I want to know how I could use MongoDB through MongoHQ with an app hosted on PHPFog. Phpfog uses Github to push commits in your base folder. Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倾其所爱 2024-11-22 15:03:27

使用 http://www.php.net/manual/en/class.mongo。 php 从 PHP 使用 MongoDB。

登录MongoHQ并创建数据库。获取连接 URL,应该是这样的:

mongodb://:@flame.mongohq.com:27101/testing

然后在 PHP 中使用此行进行连接到数据库:

$m = 新Mongo("mongodb://:@flame.mongohq.com:27101");

请记住删除连接 URL 末尾的 /testing。

Use http://www.php.net/manual/en/class.mongo.php to use MongoDB from PHP.

Log in to MongoHQ and create a database. Get the connection URL, which should be something like this:

mongodb://<user>:<password>@flame.mongohq.com:27101/testing

Then use this line in PHP to connect to the database:

$m = new Mongo("mongodb://<user>:<password>@flame.mongohq.com:27101");

Remember to remove the /testing at the end of the connection URL.

我家小可爱 2024-11-22 15:03:27

登录您的 phpfog 帐户,选择您想要 mongoHQ DB 的应用程序。单击“附加组件”并选择 MongoHQ。就这么简单:)

log into your phpfog account select the app you want mongoHQ DB on. Click "add-ons" and select MongoHQ. that simple :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文