MONGO extensions for MongoDB and PHP installed under CentOS

Source: Internet
Author: User
Tags auth fpm install mongodb

Installing MongoDB

1, the following to install MongoDB, first download:

    cd/usr/src    wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.4.tgz

(if download is slow, you can manually download and upload the server, manually download the reference address: HTTP://PECL.PHP.NET/PACKAGE/MONGODB)

2, unzip, enter the directory:

    tar -zxvf mongodb-linux-x86_64-2.6. 4. tgz-c/usr/src    cd mongodb-linux-x86_64-2.6.  4

3. Create a directory of databases and logs:

    mkdir Log     mkdir DB

4. Start in the background running mode:

    ./bin/mongod--dbpath=./db--logpath=./log/mongodb.log--fork--auth

The following is displayed:

    until  for connections.     4623 Child     Process started successfully, parent exiting

5. Set Boot start:

    Echo " /usr/src/mongodb-linux-x86_64-2.6.4/bin/mongod--dbpath=/usr/src/mongodb-linux-x86_64-2.6.4/db--logpath=/ Usr/src/mongodb-linux-x86_64-2.6.4/log/mongodb.log--fork--auth" >>/etc/rc.local

OK, fix it, and then you can see the lower port netstat -nalupt | grep mongo :

    0 0 0.0. 0.0:270170.0. 0.0 4623/./bin/mongod

Installing MongoDB Extensions

1. Download Php_mongo extension:

wget http://pecl.php.net/get/mongo-1.6.12.

(if download is slow, you can manually download and upload the server, manually download the reference address: Http://pecl.php.net/package/mongo)

2, unzip, enter the directory:

tar -xvzf mongo-1.6.  A CD MONGO-1.6.  A

3, compile, install:

phpize. /configure--with-php-config=/usr/bin/php-configmake doinstall

4, modify the php.ini configuration file, add a bit of content:

Extension=mongo.so

5. Restart PHP-FPM:

Systemctl Restart PHP-FPM

MONGO extensions for MongoDB and PHP installed under CentOS

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.