แสดงบทความที่มีป้ายกำกับ mongodb แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ mongodb แสดงบทความทั้งหมด

วันพฤหัสบดีที่ 8 ธันวาคม พ.ศ. 2554

ubuntu installing mongodb- part II : install php driver

After finishing this part, your php will be able to use mongodb function. 

To install mongodb php driver, first of all we need pecl to install from PHP repository. 
#sudo apt-get install php5-dev php5-cli php-pear
Running pecl to get and install php driver. 
#sudo pecl install mongo
Turn your back to the screen and have a coffee while system compiling the mongo extension. After finishing installation, you will see this : 
Build process completed successfully
Installing '/usr/lib/php5/20090626+lfs/mongo.so'
install ok: channel://pecl.php.net/mongo-1.2.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
Then, edit php.ini  (/etc/php5/cli/php.ini, ubuntu)  and add this line extension=mongo.so.


Reference : http://www.mongodb.org/display/DOCS/PHP+Language+Center

วันพุธที่ 30 พฤศจิกายน พ.ศ. 2554

ubuntu installing mongodb- part I : install server




The newest version of mongodb is not in repository of ubuntu. To install newest 2.0, custom repository 10gen is needed.

Add key :
#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

Add repository by creating file name '/etc/apt/sources.list.d/10gen.list'
with this line :
(using upstart)
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
You're ready to install :
#apt-get update#apt-get install mongodb-10gen
The mongodb is running in the system. The configuration for mongodb is /etc/mongodb.conf and in /etc/init/mongodb.conf (for startup script)

Reference:
http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages