• Blogs (9)
    • 📱 236 - 992 - 3846

      đź“§ jxjwilliam@gmail.com

    • Version: ‍🚀 1.1.0
  • Install MongoDB with Windows XAMPP

    Blogs20122012-06-04


    Install MongoDB with Windows XAMPP

    I found a useful article How to install MongoDB to use with XAMPP on Windows when I struggled with the correct version of php_mongo.dll.

    Step1

    Installing MongoDB

    1. Download MongoDB from http://www.mongodb.org/downloads
    2. Extract the archive
    3. Open Command Prompt
    4. Goto mongodbbin folder
    5. Type to create DB repository and start daemon:
    mkdir C:mongodbdb
    mongod.exe --dbpath=C:mongodbdb

    Step2

    Check your Php version by going to http://localhost/xampp/phpinfo.php
    note down the following from the below image
    first the php version(here 5.3) then the php extension build (here ts,vc6)

    mongo

    1. Download MongoDB driver from github.com/mongodb/mongo-php-driver/downloads
    2. Extract driver and copy the dll that matches your php version installed on your xampp (here mongo-1.1.4-php5.3vc6ts) and put to php/ext folder
    3. Open php.ini file
    4. Append this extension=php_mongo.dll, save php.ini file, and then restart your web server.

    if every thing went fine then 

    1. Point your browser at localhost and select your language, then phpinfo() from the left menu
    2. Make sure there’s a Mongo section

    The core is the ’PHP Extension Build: API20090626,TS,VC6’ option in localhost/xampp/phpinfo.php, the ’TS,VC6’ here is important for download correct php_mongo.dll version, others corrupt.

    Step 3

    Try out this example from here http://www.php.net/manual/en/mongo.tutorial.php to test mongodb is working