As MongoDB becomes more and more relevant to my work, I have decided to look into it more seriously... register for a course for developer on MongoDB University, choose a server-side application to work with MongoDB for testing and training, etc. I've chosen PHP to test MongoDB. It turned out that installing PHP Driver for MongoDB was the most painful process. Mainly, it was compatibility issue.

Here are some documentation that I followed:

  1. My environment: Windows 8 (64-bit), Apache 2.4.9, PHP 5.5.12.
  2. I downloaded MongoDB at: https://www.mongodb.org/downloads.
  3. I followed the instructions here to install MongoDB on Windows: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/.
  4. I installed PHP Driver via a documentation here: http://docs.mongodb.org/ecosystem/drivers/php/ and https://github.com/mongodb/mongo-php-driver.
  5. I downloaded PHP Drivers from both here http://pecl.php.net/package/mongo and https://s3.amazonaws.com/drivers.mongodb.org/php/index.html.

At first, I had PHP 5.6.x installed on my machine. None of the PHP Driver for MongoDB worked with this version of PHP. A matter of fact, I've tried with PHP older versions and later versions than 5.5.12. After I installed PHP 5.5.12 and I tried many versions of PHP Driver for MongoDB. I found the one that is compatible: php_mongo-1.5.1-5.5-vc11.dll. It was part of the "php_mongo-1.5.1" which I downloaded from https://s3.amazonaws.com/drivers.mongodb.org/php/index.html. So, to summary, if you want to test MongoDB on PHP on Windows 8, install:

  1. WampServer 2.5, which comes with:
    • Apache 2.4.9
    • PHP 5.5.12
  2. php_mongo-1.5.1 (php_mongo-1.5.1-5.5-vc11.dll)
  3. DON'T forget to copy php_mongo-1.5.1-5.5-vc11.dll to the ".../php/ext" folder.
  4. In php.ini, DON'T forget to set the extention=php_mongo-1.5.1-5.5-vc11.dll.