Installing PHP driver for MongoDB in WAMP

I’ve been getting more curious about MongoDB. The problem is I’ve been struggling trying to create a development environment. I’ve tried OSX, Ubuntu, and Windows. I always get stuck at a step. I think I found the right recipe.

First, I’m running Windows 7 Professional 64 bit virtually. You don’t have to run Windows virtuall. I’m mostly on my Mac and I prefer to use virtual environments for development so it’s okay if I screw around with things. Then I installed Wamp. The key here is to use the 32bit version of Wamp. I’ve tried the 64bit version of Wamp and could not get it to work. Then, you need to download the latest driver from the MongoDB website. You will get a NTS (non-thread safe) and TS (thread safe) driver. The folders are labeled as follows “mongo-[version]-php5.3vc9” and “mongo-[version]-php5.3vc9ts. Remember “ts” = “thread safe”. I used the non-thread safe DLL file. Take that DLL file and copy and paste it in the “ext” folder within the PHP installation directory of Wamp. If you installed using default settings it should be “c:wampbinphpphp5.3.xext”. Open the php.ini file and add the php_mongo.dll extension. Restart Apache and it should show up in your phpinfo() page.

I will be using MongoHQ to try things out. I’m not sure why I couldn’t get it to work in a 64bit web server environment. Mongo looks very cool and if it can help me decrease development time, I’m going to build future web apps with it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s