PHP mongdb Driver 1.17

Source: Internet
Author: User
Tags install mongodb

Installation

To build and install the driver:

$ pecl install mongodb$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`


Install for 64-bit linux1download the binary files for the desired release of MongoDB.

Download the binaries from https://www.mongodb.org/downloads.

For example, to download the latest release through the shell, issue the following:

Curl-o https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.6.tgz
2Extract the files from the downloaded archive.

For example, from a system shell, you can extract through the tar command:

TAR-ZXVF mongodb-linux-x86_64-3.2.6.tgz
3Copy the extracted archive to the target directory.

Copy the extracted folder to the location from which MongoDB would run.

Mkdir-p mongodbcp-r-N mongodb-linux-x86_64-3.2.6/mongodb
4Ensure the location of the binaries are in thePATHVariable.

The MongoDB binaries is in the bin/ directory of the archive. To ensure the binaries is in yourpath, you can modify your path.

For example, you can add the following line to your shell ' s rc file (e.g. ~/.BASHRC):

PATH=<mongodb-install-directory>/bin:$PATH 

Replace <mongodb-install-directory> with the path to the extracted MongoDB archive.

Run MongoDB Community edition1create the data directory.

Before you start MongoDB for the first time, create the directory to which the mongod process would write data. By default, the mongod process uses the /data/db directory. If you create a directory of other than this one, you must specify that directory in the dbpath option when starting The mongodprocess later in this procedure.

The following example command creates the default /data/db directory:

Mkdir-p/data/db
2Set permissions for the data directory.

Before running Mongod for the first time, ensure then the user account running mongod have read and write Permissions for the directory.

3Run MongoDB.

To run MongoDB, run the mongod process at the system prompt. If necessary, specify the path of theMongod or the data directory. See the following examples.

Run without specifying paths

If your system PATH variable includes the location of the mongod binary and if you use the default data Directory (i.e., /data/db), simply enter Mongod at the system prompt:

Mongod
Specify the path of theMongod

If your path does not include the location of the mongod binary, enter the full PATH to the mongod binary at the system prompt:

<path to Binary>/mongod
Specify the path of the data directory¶

If you don't use the default data directory (i.e. /data/db), specify the path to the data directory using the C1>--dbpath Option:

Mongod--dbpath <path to Data directory>
 

PHP mongdb Driver 1.17

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.