简体   繁体   中英

How do I fix "PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb' "

I am trying to install and set up mongodb with a laravel application for the first time. I read that I have to install the extension and libraries but after I do that I get the above error when I try to execute a php command in the terminal.

I am running windows 10 x64 and PHP 7.3.1.

First of all I installed the mongodb from the official mongodb site

I got the latest mongodb dll from https://pecl.php.net/package/mongodb/1.6.0/windows

I extracted the dll into the c:/xampp/php/ext folder according to the instructions and restarted the server.

I also included the extension = php_mongodb.dll in the php.ini file

This is what I get...

在此处输入图片说明

I found a similar post on here PHP unable to load dynamic library (mongo.so) that could have solved my problem but that solution is for users on mac and I am on windows.

I'm answering my own question here. Turns out my xampp version was x86 and so x64 version of the dll would obviously not work... Solution was to just use x86 version of the dll instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM