Mongodb PHP extensions and installation

Source: Internet
Author: User
Tags zts

???????????????????????? Mongodb PHP Extension

MongoDB Installation

1: Download MongoDB www.mongodb.org Download the latest version of stable

2: Unzip the file

3: Do not compile, itself is the compiled binary executable file.

4: Start the Mongod service

./bin/mongod--dbpath/path/to/database--logpath/path/to/log--fork--port 27017

Parameter explanation:

--dbpath Data Storage Directory

--logpath Log Store Directory

--port Run port (default 27017)

--fork Background Process Run

./bin/mongod–dbpath/home/mdb–logpath/home/mlog/m1.log–fork–port 27017–smallfiles

./bin/mongo

To connect to a server:

?

MongoDB's PHP extension s

    1. Pecl.php.net

2. Download Php-mongodb extension

3, mongodb-1.1.6:

Http://pecl.php.net/get/mongo-1.6.13.tgz

?

4. Compiling and Installing:

$ tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz
$ CD mongodb-mongodb-php-driver-<commit_id>
[Email protected] mongo-1.6.13]#/usr/local/php5.6/bin/phpize
[Email protected] mongo-1.6.13]#/configure--with-php-config=/usr/local/php5.6/bin/php-config
[[email protected] mongo-1.6.13]# make && make install

After successful compilation:

/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/

5 , find php.ini File: Find/-name php.ini

Vim/etc/php.ini

Add one line:extension=/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/ mongo.so

after executing the above command, you need to modify php.ini files, in php.ini files are added MONGO configuration, configured as follows:

Note: you need to indicate The path to the Extension_dir configuration item.

?

6. Finally check if Phpinfo () is installed successfully:

Mongodb PHP extensions and installation

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.