Ubuntu installs MongoDB and PHP extensions

Source: Internet
Author: User
Tags install mongodb

MongoDB is a scalable, high-performance, open-source NoSQL document database. The main use of C + + development completed. Document-oriented storage, full-index support, replication and high-availability, auto-sharding features. It is the most feature-rich document database in a non-relational database, most like a relational database. The data structure is loosely formatted as JSON-like Bjson.

Specific methods:

Configuration Package Management System:

1. Ubuntu Package management tool ensures consistency and reliability of downloaded packages. The console executes the following command to import the 10gen public GPG Key:

[HTML]View Plaincopy print?
    1. sudo apt-key adv--keyserver keyserver.ubuntu.com--recv 7F0CEB10

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

Enter the bottom content in the insert state to get the 10gen target library

[HTML]View Plaincopy print?
    1. Deb Http://downloads-distro.mongodb.org/repo/ubuntu-upstart Dist 10gen

3. Execute the command below to get the latest library content

[HTML]View Plaincopy print?
    1. sudo apt-get update

Installing MongoDB Packages

[HTML]View Plaincopy print?
    1. sudo apt-get install Mongodb-10gen

Complete the installation!

Configure MongoDB

Config file in/etc/directory, execute command vi/etc/mongodb.conf

Run with MongoDB user, MongoDB database file in , database log file in /var/log/mongodb

Running MongoDB

[HTML]View Plaincopy print?
    1. sudo service MongoDB start

Stop MongoDB

[HTML]View Plaincopy print?
    1. sudo service MongoDB stop

Restart MongoDB

[HTML]View Plaincopy print?
    1. sudo service MongoDB restart

Installing the MongoDB PHP extension

1. Download the source code and unzip itSOURCE Package Address Http://pecl.php.net/get/mongo-1.4.0.tgz
2. InstallationAssuming that the extracted directory is mongo-1.4.0 into the mongo-1.4.0 directory, execute it sequentially: [Plain]View PlainCopy
    1. Phpize
    2. ./configure
    3. Make
    4. Make install
After successful installation, you will get a hint similar to the followingInstalling Shared extensions:/usr/lib/php5/20121212/mongo.so (or other directory files)
Under this directory you will find mongo.so
3. Modify the PHP configurationJoin in the php.ini [Plain]View PlainCopy
    1. Extension=/usr/lib/php5/20121212/mongo.so

Ubuntu installs MongoDB and PHP extensions

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.