Home  >  Article  >  Backend Development  >  MongoDB installation, mongodb_PHP tutorial

MongoDB installation, mongodb_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:52:42981browse

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

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>

7) Start service

net start mongodb

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

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...
Statement:
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