Dutch PHP Conference 2025 - Call For Papers

Installing the MongoDB PHP Extension on Windows

Precompiled binaries are attached to the project's » Github releases. Archives are published for various combinations of PHP version, thread safety (TS or NTS), and architecture (x86 or x64). Determining the correct archive for the PHP environment and extract the php_mongodb.dll file to the extension directory ("ext" by default).

Add the following line to the php.ini file for each environment that will need to use the extension:

extension=php_mongodb.dll

Failure to select the correct binary will result in an error when attempting to load the extension DLL at runtime:

PHP Warning:  PHP Startup: Unable to load dynamic library 'mongodb'

Ensure that the downloaded DLL corresponds to the following PHP runtime properties:

In addition to the aforementioned constants, these properties can also be inferred from phpinfo(). If a system has multiple PHP runtimes installed, double-check that the phpinfo() output is for the correct environment.

Зауваження: Additional DLL dependencies for Windows Users

Щоб це розширення працювало у Windows, системна змінна PATH повинна мати доступ до файлів DLL. Як це зробити, написано в ЧаПах під назвою "Як додати PHP-теку до PATH у Windows". Хоча копіювання DLL-файлів з PHP-теки в системну теку Windows теж спрацює (тому, що системна тека зазвичай є в змінній PATH), проте цього не слід робити. Це розширення вимагає, щоб наступні файли були в PATH: libsasl.dll

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top