Home >Backend Development >PHP Tutorial >MongoDB installation
1) Windows 7 64bit
2) MongoDB browsing
1) Unzip mongodb-win32-x86_64-3.0.3.zip to d:program_filesMongoDB
2) d:program_filesMongoDBbin is added to the environment variable %mongo%
3) Create the directory %mongo%datadb to store the database
4) Create the directory %mongo%datalog to store the log
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 --c/span><span>"</span>D:\program_files\MongoDB\mongod.cfg\<span>""</span></span>
7) Start the 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 a PHP environment for browsing
2) Download the MongoDB PHP extension for browsing, 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) Browse the MongoDB PHP manual
The above has introduced the installation of MongoDB, including all aspects. I hope it will be helpful to friends who are interested in PHP tutorials.