Posted: 2014-04-23 20:52:05
WampDeveloper comes with MongoDB located in folder:
MongoDB can either be started:
A) Manually from the command-line:
mongod --config C:\WampDeveloper\Tools\mongodb\mongodb.conf
B) Or by double-clicking entry “MongoDB” in WampDeveloper’s Applications Tab, in which case, WampDeveloper will run file:
The MongoDB server will run as long as the command-line window is open.
To connect and talk to the MongoDB server via PHP code, PHP extension php_mongo must be loaded.
1. Edit file:
2. Uncomment section:
[Mongo] extension=php_mongo.dll mongo.allow_empty_keys=0 mongo.chunk_size=262144 mongo.cmd="$" mongo.default_host="127.0.0.1" mongo.default_port="27017" mongo.is_master_interval=15 mongo.long_as_object=0 mongo.native_long=0 mongo.ping_interval=5
(* uncomment by removing “;”, section is located near end of file)
3. Save file and restart Apache.
A REST interface to some MongoDB stats and information is provided on URL:
Example PHP code to test the operations of the MongoDB server is provided here: