使用 MongoHQ 和 PHPFog
这里是新手。我很困惑。我想知道如何通过 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 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.
登录您的 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 :)