Home > Backend Development > PHP Tutorial > MongoDB installation, mongodb_PHP tutorial

MongoDB installation, mongodb_PHP tutorial

WBOY
Release: 2016-07-13 09:52:42
Original
1000 people have browsed it

MongoDB installation, mongodb

1. Prepare the required tools

1) Windows 7 64bit

2) MongoDB browsing

2. Installation

1) Unzip mongodb-win32-x86_64-3.0.3.zip to d:program_filesMongoDB

2) Add d:program_filesMongoDBbin to the environment variable %mongo%

3) Create the directory %mongo%datadb to store the database

4) Create directory %mongo%datalog to store logs

5) Create and edit the configuration file %mongo%mongod.cfg

dbpath=<span>D:\program_files\MongoDB\data\db
logpath</span>=D:\program_files\MongoDB\data\log\mongo.log
Copy after login

6) Install MongoDB as a service

Run the following command with administrator privileges to create the MongoDB service

sc create MongoDB binPath= <span>"</span><span>\</span><span>"</span>D:\program_files\MongoDB\bin\mongod.exe\<span>"</span><span> --service --config=\</span><span>"</span>D:\program_files\MongoDB\mongod.cfg\<span>""</span><span><br /></span>
Copy after login

7) Start service

net start mongodb
Copy after login

3. Use

1) Start the command line and enter mongo

2) show dbs

3) use test

4) insert

5) find

4. PHP development

1) Set up PHP environment Browse

2) Download MongoDB PHP extension, browse, and put it in the %PHP%ext directory

3) Modify php.ini and add the following code

extension=php_mongo.dll
Copy after login

4) Restart the Apache server

5) MongoDB PHP Manual View

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1007362.htmlTechArticleMongoDB installation, mongodb 1. Prepare the required tools 1) Windows 7 64bit 2) MongoDB browsing 2. Installation 1) Unzip mongodb-win32-x86_64-3.0.3.zip to d:program_filesMongoDB 2)d:program_fil...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template