Install MongoDB and PHPMongoDBDriver in Ubuntu14.04

Source: Internet
Author: User
Tags install mongodb mongodb driver php mongodb mongodb support
It indicates that MongoDB is a very famous NOSQL database. The following is the installation of MongoDB under Ubuntu14.04, as well as the configuration for PHP (driver Installation, etc.). This method is applicable to Homestead. Install MongoDB1. add source sudoapt-keyadv -- keyserverhkp: // keyserver.ubuntu.com: 80 -- recv7F0CEB

Description

MongoDB is a very famous NOSQL database. The following is the installation of MongoDB in Ubuntu 14.04, as well as the configuration for PHP (driver Installation, etc.). This method is applicable to Homestead.

Install MongoDB

1. Add Source
Sudo apt-key adv -- keyserver hkp: // keyserver.ubuntu.com: 80 -- recv 7F0CEB10
Echo 'Destroy http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen '| sudo tee/etc/apt/sources. list. d/mongodb. list
Sudo apt-get update

2. Start Installation

You can customize the installed Package here.
Sudo apt-get install-qq mongodb-org

Check whether the installation is complete:
$ Ps-ef | grep mongo
Mongodb 15683 1 1? 00:00:37/usr/bin/mongod -- config/etc/mongod. conf

Check version:
$ Mongo -- version
MongoDB shell version: 2.6.6
$ Mongo
> Db. test. save ({test: 100 })
> Db. test. find ()
{"_ Id": ObjectId ("549253f4d91767276c02fc14"), "test": 100}

Path information and default parameter description:
• Sources:/usr/bin/
• Logs:/var/log/mongodb/mongod. log
• Data:/var/lib/mongodb/
• Default ip: 127.0.0.1
• Default port MongoDB is listening: 27017

You can modify the above information by editing/etc/mongod. conf.

Enable/disable
$ Sudo service producer D start
$ Sudo service producer D stop
$ Sudo service producer D restart

Install PHP Mongodb Driver

1. install Driver
Echo "no"> answers.txt
Sudo pecl install mongo <answers.txt
Rm answers.txt

2. Enable PHP Extension
Echo 'extension = mongo. so' | sudo tee/etc/php5/mod-available/mongo. ini
Sudo ln-s/etc/php5/mod-available/mongo. ini/etc/php5/fpm/conf. d/mongo. ini
Sudo ln-s/etc/php5/mod-available/mongo. ini/etc/php5/cli/conf. d/mongo. ini

Restart the server
Sudo service php5-fpm restart

Verify whether the installation is successful
$ Php-I | grep 'mongo'
MongoDB Support => enabled

: Sparkles:

For more MongoDB tutorials, see the following content::

CentOS compilation and installation of php extension http://www.linuxidc.com/Linux/2012-02/53833.htm for MongoDB and mongoDB

CentOS 6 install MongoDB with yum and configure http://www.linuxidc.com/Linux/2012-08/68196.htm on the server side

Install MongoDB2.4.3 http://www.linuxidc.com/Linux/2013-05/84227.htm in Ubuntu 13.04

MongoDB entry must read (both concepts and practices) http://www.linuxidc.com/Linux/2013-07/87105.htm

MongoDB Installation Guide http://www.linuxidc.com/Linux/2014-08/105364.htm in Ubunu 14.04

MongoDB authoritative Guide (The Definitive Guide) English version [PDF] http://www.linuxidc.com/Linux/2012-07/66735.htm

Nagios monitor MongoDB sharded cluster service practice http://www.linuxidc.com/Linux/2014-10/107826.htm

MongoDB service http://www.linuxidc.com/Linux/2014-11/108900.htm Based on CentOS 6.5 Operating System

MongoDB details: Click here
MongoDB: Click here

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2016-03/129050.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.