Install MongoDB and PHP extensions in Ubuntu

Source: Internet
Author: User
Tags install mongodb

Install MongoDB and PHP extensions in Ubuntu

MongoDB is a scalable and high-performance open-source NoSQL document database. It is mainly developed using C ++. For document storage, full index support, replicable and high availability, automatic sharding, and other features. Among non-relational databases, DRDs is the most versatile and most similar to relational database document databases. The data structure is loose and is similar to the json bjson format.

Specific Method:

Configuration package management system:

1. the Ubuntu package management tool ensures the consistency and reliability of the downloaded package. Run the following command on the console to import the 10gen public GPG Key:

Sudo apt-key adv -- keyserver keyserver.ubuntu.com -- recv 7F0CEB10

2. Execute Command vi/etc/apt/sources. list. d/10gen. list

Enter the following content in the insert status to obtain the 10gen target database.

Deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

3. Execute the following command to obtain the latest library content

Sudo apt-get update

Install MongoDB package

Sudo apt-get install mongodb-10gen

Complete the installation!

Configure MongoDB

Run the command vi/etc/mongodb. conf in the/etc/directory of the configuration file.

Mongodb users are running, MongoDB database files are in, and database log files are in/var/log/mongodb

Run MongoDB

Sudo service mongodb start

Stop MongoDB

Sudo service mongodb stop

Restart MongoDb

Sudo service mongodb restart

Install PHP extensions for MongoDB

1. Download and decompress the source code

Source package address http://pecl.php.net/get/mongo-1.4.0.tgz

2. Installation

Assume that the extracted directory is a mongo-1.4.0

Go to the mongo-1.4.0 directory and execute:

  • Phpize
  • ./Configure
  • Make
  • Make install

After the installation is successful, you will receive a message similar to the following:

Installing shared extensions:/usr/lib/php5/20121212/mongo. so (or other directory files)

In this directory, you will find mongo. so

3. Modify php configuration

Add in php. ini

Extension =/usr/lib/php5/20121212/mongo. so

For more MongoDB tutorials, see the following:

CentOS compilation and installation of php extensions for MongoDB and mongoDB

CentOS 6 install MongoDB and server configuration using yum

Install MongoDB2.4.3 in Ubuntu 13.04

MongoDB beginners must read (both concepts and practices)

MongoDB Installation Guide for Ubunu 14.04

MongoDB authoritative Guide (The Definitive Guide) in English [PDF]

Nagios monitoring MongoDB sharded cluster service practice

Build MongoDB Service Based on CentOS 6.5 Operating System

MongoDB details: click here
MongoDB: click here

This article permanently updates the link address:

Related Article

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.