0

I try to install mongodb with PHP 7.4.9 and WAMP with Apache 2.4.46.

  • I downloaded php_mongodb-1.8.1-7.4-ts-vc15-x86 and copied php_mongodb.dll into C:\wamp64\bin\php\php7.4.9\ext

  • then I add extension=php_mongo.dll in C:\wamp64\bin\apache\apache2.4.46\bin\php.ini and C:\wamp64\bin\php\php7.4.9\php.ini

  • then I restart WAMP, but there is no module "mongodb" displayed in phpinfo(), but it is active in:

wamp

When I launch this code:

$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017/");

There is an error :

( ! ) Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in C:\wamp64\www\index.php on line 3
( ! ) Error: Class 'MongoDB\Driver\Manager' not found in C:\wamp64\www\index.php on line 3

Do you have any ideas how to make that work?

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Fafa
  • 21
  • 1
  • 3
  • 1
    This link might help: https://stackoverflow.com/questions/37145401/wamp-mongodb-php-extension – Tim Nov 03 '20 at 20:35

1 Answers1

0
  1. Download PHP MongoDB driver from here
  2. Add DLL library path to your php.ini file as below
extension=php_mongodb.dll

Also see this article

Your problem is php_mongo.dll and php_mongodb.dll are different libraries.

That is good explanation

OR

Just a setting mistake

i downloaded php_mongodb-1.8.1-7.4-ts-vc15-x86 and copied php_mongodb.dll in "C:\wamp64\bin\php\php7.4.9\ext" then i add "extension=php_mongo.dll"

You copied php_mongodb.dll ans set "extension=php_mongo.dll"

rzlvmp
  • 7,512
  • 5
  • 16
  • 45
  • Thanks, i downloaded "php_mongodb-1.8.1-7.4-ts-vc15-x64" version 64 bit because my wamp install is in 64 bit then i copied the file php_mongodb.ddl in "C:\wamp64\bin\php\php7.4.9\ext" and i added in php.ini "extension=php_mongodb.dll" and it's worked. Thanks a lot – Fafa Nov 03 '20 at 09:41