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 Linux

1

Download 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
2

Extract 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
3

Copy the extracted archive to the target directory.

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

mkdir -p mongodb
cp -R -n mongodb-linux-x86_64-3.2.6/ mongodb
4

Ensure the location of the binaries is in the PATH variable.

The MongoDB binaries are in the bin/ directory of the archive. To ensure that the binaries are in yourPATH, you can modify your PATH.

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

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

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

Run MongoDB Community Edition

1

Create the data directory.

Before you start MongoDB for the first time, create the directory to which the mongod process will write data. By default, the mongod process uses the /data/db directory. If you create a directory 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
2

Set permissions for the data directory.

Before running mongod for the first time, ensure that the user account running mongod has read and write permissions for the directory.

3

Run 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 the mongod

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

<path to binary>/mongod

Specify the path of the data directory

If you do not use the default data directory (i.e., /data/db), specify the path to the data directory using the --dbpath option:

mongod --dbpath <path to data directory>
 

php mongdb driver 1.17的更多相关文章

  1. Practical Node.js (2018版) 第7章:Boosting Node.js and Mongoose

    参考:博客 https://www.cnblogs.com/chentianwei/p/10268346.html 参考: mongoose官网(https://mongoosejs.com/docs ...

  2. DB2 syntax error

    Error infomation:  An unexpected token "JOIN" was found following "". Expected t ...

  3. selenium的一些使用方法

    新建实例driver = webdriver.Chrome()1.通过标签属性Id查找元素方法:find_element_by_id(element_id)实例:driver.find_element ...

  4. selenium2 webdriver 常用的python 函数

    新建实例driver = webdriver.Chrome() 1.通过标签属性Id查找元素 方法:find_element_by_id(element_id) 实例:driver.find_elem ...

  5. Python Selenium 常用方法总结(不断补充)

    还有此篇内容也丰富Selenium常见元素定位方法和操作的学习介绍 selenium Python 总结一些工作中可能会经常使用到的API. 1.获取当前页面的Url 方法:current_url 实 ...

  6. Spark记录-Spark-Shell客户端操作读取Hive数据

    1.拷贝hive-site.xml到spark/conf下,拷贝mysql-connector-java-xxx-bin.jar到hive/lib下 2.开启hive元数据服务:hive  --ser ...

  7. Python Selenium 常用方法总结

    selenium Python 总结一些工作中可能会经常使用到的API. 1.获取当前页面的Url 方法:current_url  实例:driver.current_url    2.获取元素坐标 ...

  8. python3+selenium3.13的简单操作

    1.浏览器 1.1 浏览器窗口大小位置 driver.set_window_size(self, width, height, windowHandle) 将某个窗口设置为固定大小 driver.se ...

  9. selenium2.0关于python的常用函数

    转: 新建实例driver = webdriver.Chrome() 1.获取当前页面的Url函数 方法:current_url 实例: driver.current_url 2.获取元素坐标 方法: ...

随机推荐

  1. IF EXISTS 两个条件连用

    当IF EXISTS要判断多个条件并存时,可以用AND连接,NOT EXISTS同理 IF EXISTS (SELECT 1 ) AND EXISTS (SELECT 2 ) BEGIN ...... ...

  2. css美化Div边框的样式实例*(转载)

    css美化Div边框的样式实例   很多时候如果不是用了很多样式,很难把边框修饰得好看,看了一篇博文,觉得真的挺漂亮,也挺好看. 转载的博文地址 将这段美化的css代码 border:1px soli ...

  3. 用python脚本测试接口

    自己写一个脚本,统计调用200次接口的请求时长. # -*- coding=utf-8 -*-import osimport requestsimport time url = "http: ...

  4. php设计模式之多态实例代码

    <?php header("Content-type:text/html;charset=utf-8"); /** * 虎 */ abstract class Tiger { ...

  5. 三值的排序 Sorting a Three-Valued Sequence(洛谷 P1459USACO2.1,IOI96Day2)

    Sorting a Three-Valued Sequence IOI'96 - Day 2 Sorting is one of the most frequently performed compu ...

  6. Go_select

    select 是 Go 中的一个控制结构.select 语句类似于 switch 语句,但是select会随机执行一个可运行的case.如果没有case可运行,它将阻塞,直到有case可运行. sel ...

  7. mysql忘记密码,更改密码

    对MySQL有研究的读者,可能会发现MySQL更新很快,在安装方式上,MySQL提供了两种经典安装方式:解压式和一键式,虽然是两种安装方式,但我更提倡选择解压式安装,不仅快,还干净.在操作系统上,My ...

  8. promise学习,多看几次。含node,ES6知识

    一.引出promise解决回调地狱 需求:你要封装一个方法,我给你一个要读取文件的路径,你这个方法能帮我读取文件,并把内容返回给我 目录图片 三个txt里面的内容分别是111,222,333 1.模块 ...

  9. Windows server 2012文件服务器配置

    文件服务器的管理   Windows server 2012提供了易于使用的管理工具,让系统管理员更有效的管理服务器的资源. 安装文件服务器管理工具 添加角色-安装管理器 安装完成后直接可以在工具中打 ...

  10. Debian 系统修改网卡ens33名称为 eth0

    1. 编辑文件 /etc/default/grub 修改下面的值 初始值 GRUB_CMDLINE_LINUX="" 修改后 GRUB_CMDLINE_LINUX="ne ...