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!

3 comments:

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

    Thanks

    ReplyDelete
  2. As a powerful example, some sort of song list 'Rhythm the night' has recently been employed on both Debarge and Corona.

    Added reports hold Form C, D, Bonus offer Register but
    Bonus In summary. All of the formula, At = W x Vice
    president x 5.25 is second-hand to search for the area for septic
    tank.

    Feel free to visit my blog post ... software jokes - http://www.dummy.com -

    ReplyDelete