Installing MongoDB on WampServer

  1. Download MongoDB http://www.mongodb.org/downloads
  2. Extract it on specific folder. I suggest you to extract that on bin directory. So, I created it first before extracting that files.
    • Open Start > Run > cmd
    • type this command : cd C:\wamp  (assume that you install WampServer on that folder, you free to change directory like cd DRIVE:\YOUR_FOLDER)
    • cd bin
    • mkdir mongodb
    • mkdir data
    • cd data
    • mkdir db
    • cd..
    • mkdir bin
    • mkdir logs
  3. After you created that folders, you should extract it in folder. i.e: C:\wamp\bin\mongodb\bin
  4. OK. Now it’s time to download mongodb drivers for PHP. You can download it inhttp://github.com/mongodb/mongo-php-driver/downloads
  5. Open mongo-x.x.x.zip, generally, you should select the generic build for your php version after unzipping it.
  6. Extract php_mongo.xxxxxxxxx.dll to C:\wamp\bin\php\php5.3.5\ext. Modify the extension section in php.ini and add “extension=php_mongo.dll”.
  7. Check “php_mongo” extension and the wampserver will restart and dynamically load the driver.
  8. Ok, back to C:\mongodb\bin folder via cmd (cd C:\mongodb\bin)
  9. type this command:
    mongod --logpath C:\wamp\bin\mongodb\logs\error.log --logappend --dbpath 
    C:\wamp\bin\ mongodb\data\db --directoryperdb --install
  10. go to C:\wamp\bin\mongodb\ by windows explorer.
    Create new batch file named startmongo.bat
    type this : net start “MongoDB” 
    That file is for starting mongodb service, if windows doesn’t start the service.

Share on Google Plus

About Elmirakom

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment