Wednesday, 8 June 2016

Load MongoDB extension for WAMP

Let's learn how to load MongoDB extension for WAMP.

It's not hard as I thought, so I would like to share it with you!

Here is steps to follow:
  1. First decide with PHP version you are using right now.
    • In my case I am using 5.5.xx
  2. Then visit MongoDB documentation.
  3. For instance I am using 5.5.xx so I will go through the mongo-1.6 which is latest and supported to my PHP version.
  4. Next it's time to download mongo package.
  5. In my case I will download 1.6 as it's right for me :)
  6. Once you clicked on DLL link under download section? Next you'll get more package information.
    • You will look into DDL list section and choose your right PHP version and right Thread Safe (TS) version for you.

      Note
      : You'll see, there are two architecture x86 and x64. I know what are you going to ask HOW DO I KNOW WHICH ONE I AM USING RIGHT? and answer is, look at your phpinfo() and you'll it from there.
  7. After that you'll download the mongodb package. In package you'll get php_mongodb.dll file, which you have to place under "ext" directory.
    • C:\wamp\bin\php\php5.5.12\ext
  8. Now update your php.ini file, add following line in your php.ini
    • extension=php_mongodb.dll
  9. That's it! fasten your belt and reset your WAMP.
  10. To check extension is loaded or not check phpinfo() and search mongodb, if you able to find it out, then you get your feet in door :)
Happy Coding!

No comments:

Post a Comment