Installing the MongoDB PHP Driver on Windows

Precompiled binaries for each release are available from » PECL for a variety of combinations of versions, thread safety, and VC libraries. Extract the archive and put php_mongodb.dll in your PHP extension directory ("ext" by default).

Add the following line to your php.ini file:

extension=php_mongodb.dll

Note: Additional DLL dependencies for Windows Users

In order for this extension to work, there are DLL files that must be available to the Windows system PATH. For information on how to do this, see the FAQ entitled "How do I add my PHP directory to the PATH on Windows". Although copying DLL files from the PHP folder into the Windows system directory also works (because the system directory is by default in the system's PATH), this is not recommended. This extension requires the following files to be in the PATH: libsasl.dll

add a note add a note

User Contributed Notes 2 notes

up
-14
Xylon Reyes
3 years ago
With the newer version of MongoDB, this should be...

extension=php_mongodb.dll

(the filename of the latest stable release at PECL)

Official MongoDB library are available at GitHub as well as its documentation.

Precompiled binaries are also available at GitHub for the legacy and the newer version.
up
-62
artin dot zareie at yahoo dot com
1 year ago
I've installed this extension but now i have this error :
PHP Warning:  PHP Startup: Unable to load dynamic library 'mongodb' (tried: D:\xampp\php\ext\mongodb (The specified module could not be found.
), D:\xampp\php\ext\php_mongodb.dll (The specified module could not be found.
)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'mongodb' (tried: D:\xampp\php\ext\mongodb (The specified module could not be found.
), D:\xampp\php\ext\php_mongodb.dll (The specified module could not be found.
)) in Unknown on line 0

Parse error: syntax error, unexpected ')', expecting variable (T_VARIABLE) in D:\xampp\htdocs\Libraries\Database.php on line 19
PHP Parse error:  syntax error, unexpected ')', expecting variable (T_VARIABLE) in D:\xampp\htdocs\Libraries\Database.php on line 19

And i know that extension exist in the "D:\xampp\php\ext" ;
To Top