0

I'm using a Windows 8 64-bit machine and a 32-bit version of WAMPServer

I echoed phpinfo() and the extension has not been loaded - it does not appear

Does anyone know how to fix this?

  • Did you actually download and install MongoDB? http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/ – Quixrick Feb 14 '14 at 17:43
  • Here is an article I found on this ... don't know if you've seen it yet, but it's geared toward getting MongoDB to work using WAMP. http://www.pronique.com/blog/installing-mongodb-on-windows-the-wamp-way – Quixrick Feb 14 '14 at 17:49

3 Answers3

4

I can't add this as a comments because of low reputation.

Did u restart your server after updating ur php.ini file.

  • I would check the server logs and see if there are any errors. Also in ur phpinfo output chk if it's loading the same php.ini file –  Feb 14 '14 at 17:50
1

Had the same issue. Below steps solved my issue.

  1. Make sure you have a 32 bit WAMP setup in place. Apparently, there are problems with 64 bit
  2. Get the lates php_mongo driver from https://github.com/mongodb/mongo-php-driver/downloads compatible with your version
  3. Rename it to php_mongo.dll and copy it to php extenstions folder. Default on windows is "ext"
  4. check phpinfo()
  5. Check for Loaded Configuration File variable. It gives you the path from where the php.ini file is read
  6. Add the line extension=php_mongo.dll to the php.ini file in the above path
  7. Restart your services
Avinash
  • 779
  • 7
  • 18
  • 2
    Please do NOT use the downloads on that github page. These are severely old as github has blocked this functionality and this page is no longer maintained (and cannot be maintained) by us. For the most up to date Windows downloads, see the project home page on pecl: http://pecl.php.net/package/mongo and click the windows logo next to the latest release – bjori Apr 09 '14 at 19:40
0

Looks like it can't load the Mongo Module.

First You have to download the stable dll zip file. PHP-MONGO

Download the Threaded-version of the module. Copy the dll file and paste it in C:\wamp64\bin\php\php5.6.19\ext (if wamp). then go to your php.ini file and paste the following script: extension=php_mongo.dll in the extensions row.

Note: There shouldn't be a ';' before the extension . Then restart WAMP. In the wamp-php-extension menu you could find the php_mongo. tick mark it. Restart Wamp.

Start mongo and the try executing the following script.

<?php
    if($connection = new mongoClient()){
        echo "Connected Successfully";
     } 
?>`

Note: First start the Mongo server.

For more info: PHP/Mongo Manual

If you have problem in start Mongo then Write the command as follows in your Mongo/bin directory:

mongod --storageEngine=mmapv1 --dbpath [your-path]

your-path= The path you want to save the Databse files. (ex: F:\data\db )

The Mongo sever would be running now. Don't close the cmd.

Gnanesh
  • 668
  • 7
  • 13