January 08, 2013

PHP MongoDB Driver not working!

In Semester 3 I have PHP unfortunately not MongoDB. So I was doing PHP practicals while I was doing my office things. So suddenly MongoDB came to my mind. Then I tried to connect to MongoDB with PHP. Although I have already tried with .NET. I never tried MongoDB with PHP. So I installed IIS 8.0 and PHP 5.3.1. 

Then I downloaded the driver from github. Extracted it to C:\Program Files (x86)\PHP\v5.3\ext\. 
I added the entry to php.ini properly. Then I restarted IIS using iisreset. But MongoDB Driver for PHP was not loaded properly. Then I was checking and doing so many things but nothing worked.

Try this way!

1. Download driver from github.

2. Extract zip file.

3. Copy php_mongo-1.3.2RC1-5.3-vc9-nts.dll to C:\Program Files (x86)\PHP\v5.3\ext\. And rename it to php_mongo.dll.

4. Then take properties of php_mongo.dll and unblock executable.
5. Then go to C:\Program Files (x86)\PHP\v5.3\ and open php.ini as Administrator and add below line to end of the file.

extension=php_mongo.dll

6. Then take a command prompt as administrator and run below command.

iisreset

Enjoy MongoDB with PHP!

4 comments:

  1. You are a genius I was loading the wrong DLL

    Thanks

    ReplyDelete
  2. Greetings! Very helpful advice within this post!
    It is the little changes that make the most significant
    changes. Thanks a lot for sharing!

    Feel free to visit my web page - no2 weight

    ReplyDelete
  3. Nice post. I learn something new and challenging on blogs
    I stumbleupon everyday. It will always be helpful to read through articles
    from other writers and practice something from other web sites.


    Here is my web blog - free downloads ()

    ReplyDelete