开发者

using MongoHQ and PHPFog

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!


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜