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: