array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'mongodb.installation.windows.php', 1 => 'Installing the MongoDB PHP Driver on Windows', ), 'up' => array ( 0 => 'mongodb.installation.php', 1 => 'Instalação', ), 'prev' => array ( 0 => 'mongodb.installation.homebrew.php', 1 => 'Installing the MongoDB PHP Driver on macOS with Homebrew', ), 'next' => array ( 0 => 'mongodb.installation.manual.php', 1 => 'Building the MongoDB PHP Driver from source', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mongodb/configure.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
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 driver:
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:
PHP_VERSION
)PHP_ZTS
)PHP_INT_SIZE
)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.
Nota: Additional DLL dependencies for Windows Users
Para que esta extensão funcione, existem arquivos DLL que devem estar disponíveis no PATH do sistema Windows. Para saber como fazer isso, veja a FAQ intitulada "Como eu adiciono o meu diretório PHP ao PATH do Windows". Embora copiar arquivos DLL da pasta do PHP para o diretório system do Windows também funcione (porque o diretório system está, por padrão, no PATH do sistema), isso não é recomendado. Esta extensão requer que os seguintes arquivos estejam no PATH: libsasl.dll