Requirement : you have installed newest WampServer
Follow these steps and each step carefully
- Download MongoDB http://www.mongodb.org/downloads
- 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
- After you created that folders, you should extract it in folder. i.e: C:\wamp\bin\mongodb\bin
- OK. Now it's time to download mongodb drivers for PHP. You can download it in http://github.com/mongodb/mongo-php-driver/downloads
- Open mongo-1.1.4.zip, click folder mongo-1.1.4-php5.3vc6ts
- Extract php_mongo.dll to C:\wamp\bin\php\php5.3.5\ext
- Ok, back to C:\mongodb\bin folder via cmd (cd C:\mongodb\bin)
- type this command:
mongod --logpath C:\wamp\bin\mongodb\logs\error.log --logappend --dbpath C:\wamp\bin\ mongodb\data\db --directoryperdb --install
- 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 - Congratulation. You just have installed mongodb on wampserver
Sorry for bad english. If you want to make errata for this article, please private message me
awesome....thanks alot
ReplyDeleteThanks! : )
ReplyDeletemongod --logpath C:\wamp\bin\mongodb\logs\error.log --logappend --dbpath
ReplyDeleteC:\wamp\bin\ mongodb\data\db --directoryperdb --install
gives me an unrecognised command error in the command line
You have to enter it with out the "Enter" space between:
ReplyDeletebpath " here is an enter that you have to delete" C:\wa .....
or just copy this :
mongod --logpath C:\wamp\bin\mongodb\logs\error.log --logappend --dbpath C:\wamp\bin\ mongodb\data\db --directoryperdb --install
Good luck
Troy ;)
when i run this command net start "MongoDB" it gives me error (service name is invalid) i am running net start "MongoDB" command in C:/wamp/bin/mongodb
ReplyDeletei am getting below error when i am trying to install it with my local wamp server.
ReplyDeleteMon May 13 10:50:27.963
Mon May 13 10:50:27.963 warning: 32-bit servers don't have journaling enabled by
default. Please use --journal if you want durability.
Mon May 13 10:50:27.963
Mon May 13 10:50:27.963 Trying to install Windows service 'MongoDB'
Mon May 13 10:50:27.963 Error connecting to the Service Control Manager: Access
is denied. (5)
You have to run cmd.exe as an administrator. For windows 7: Start --> search for cmd.exe --> right-click --> Run As Administrator.
Deletec:\wamp\bin\mongodb>mongod --logpath C:\wamp\bin\mongodb\logs\error.log --logapp
ReplyDeleteend --dbpath C:\wamp\bin\ mongodb\data\db --directoryperdb --install
'mongod' is not recognized as an internal or external command,
operable program or batch file.
Hi
ReplyDeleteAs per your blog instruction i am trying to install MongoDb on wampserver but while executing program gives following error :
"Fatal error: Class 'Mongo' not found in C:\wamp\www\test\index.php on line 19"
Could you please help me?
Thanks