> ## Content Index
> Fetch the complete content index at: https://blog.hinablue.me/llms.txt
> Use this file to discover other available public pages before exploring further.

# [mongoDB note.] Ubuntu + MongoDB + CakePHP = 芒果蛋糕
- URL: https://blog.hinablue.me/mongodb-note-ubuntu-apache-php-mongodb-quick-start/
- Published: 2011-07-13T10:07:00.000Z
- Updated: 2026-06-25T09:37:00.000Z
- Author: Hina Chen
- Tags: MongoDB, Ubuntu, CakePHP

這邊有一篇文章： [http://mark-story.com/posts/view/using-mongodb-with-cakephp](http://mark-story.com/posts/view/using-mongodb-with-cakephp?ref=blog.hinablue.me)

這裡有一篇不錯的影片： [http://www.vimeo.com/8005503](http://www.vimeo.com/8005503?ref=blog.hinablue.me)

mongoDB 在 PHP 官方安裝教學： [http://www.mongodb.org/display/DOCS/PHP+Language+Center](http://www.mongodb.org/display/DOCS/PHP+Language+Center?ref=blog.hinablue.me)

10gen 的影片： [http://www.10gen.com/presentation/mongosf-2011/php-development-with-mongodb](http://www.10gen.com/presentation/mongosf-2011/php-development-with-mongodb?ref=blog.hinablue.me)

PHP 要支援 mongo 可以用 pecl 安裝： > sudo pecl install mongo

然後在 /etc/php5/conf.d 加入一個 mongodb.ini 檔案，寫入這個： >extension=mongo.so

重新啟動 Apache 跟 php5-fpm（如果你有用的話），查看 phpinfo() 應該就會看到 mongo 了。

mongoDB 在 Ubuntu/Debian 上面的安裝過程： [http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages?ref=blog.hinablue.me)

在 Ubuntu 上面，安裝 10gen 版本支援的 mongoDB 大抵上是這樣： >sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

打開 /etc/apt/source.list 在最後面加入這一行： deb [http://downloads-distro.mongodb.org/repo/ubuntu-upstart](http://downloads-distro.mongodb.org/repo/ubuntu-upstart?ref=blog.hinablue.me) dist 10gen

sudo apt-get update sudo apt-get install **mongodb**\-10gen

然後可以跑一下 mongo --version 看看有沒有成功。

最後是跟 CakePHP 結合，這已經有神人寫好了（這是給 CakePHP 1.3 用的）！

[https://github.com/ichikaway/mongoDB-Datasource](https://github.com/ichikaway/mongoDB-Datasource?ref=blog.hinablue.me)