MongoDB installation on CentOS and PHP extension MongoDB

Source: Internet
Author: User

MongoDB's official website https://www.mongodb.org, you can download the version you want. Here is my download, installation and start-up

Curl-o-L HTTPS://FASTDL.MONGODB.ORG/LINUX/MONGODB-LINUX-X86_64-3.0.4.TGZTAR-ZXVF mongodb-linux-x86_64-3.0.4.tgz CD mongodb-linux-x86_64-3.0.4mkdir-p/usr/local/mongodbln-s/usr/local/mongodb/bin/mongod/usr/local/sbin/ Mongodmkdir-p/usr/local/mongodb/data
Vi/usr/local/mongodb/config.conf

The content to be edited is as follows

{

Dbpath=/usr/local/mongodb/data

Logpath=/usr/local/mongodb/mongdb.log

port=27017

Fork=true

Logappend=true

}

Mongod-f/usr/local/mongodb/config.conf//Start MongoDB



Let PHP support MongoDB

First, you can download the appropriate expansion pack in Http://pecl.php.net/package/mongo, here is my installation action

Wget-c http://pecl.php.net/get/mongo-1.6.10.tgztar-zxvf mongo-1.6.10.tgzcd mongo-1.6.10/usr/local/php/bin/phpize. /configure--enable-mongo=share--with-php-config=/usr/local/php/bin/php-configmakemake Install
Vi/etc/php.ini

in which to add

[MongoDB]

Extension=mongo.so


and restart PHP-FPM.





MongoDB installation on CentOS and PHP extension MongoDB

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.