Вопрос

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?

Это было полезно?

Решение 2

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

Другие советы

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

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

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top