简体   繁体   English

如何修复“PHP 警告:PHP 启动:无法加载动态库‘mongodb’”

[英]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.我第一次尝试使用 Laravel 应用程序安装和设置 mongodb。 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.我读到我必须安装扩展程序和库,但是在我这样做之后,当我尝试在终端中执行 php 命令时出现上述错误。

I am running windows 10 x64 and PHP 7.3.1.我正在运行 Windows 10 x64 和 PHP 7.3.1。

First of all I installed the mongodb from the official mongodb site首先,我从官方 mongodb 站点安装了 mongodb

I got the latest mongodb dll from https://pecl.php.net/package/mongodb/1.6.0/windows我从https://pecl.php.net/package/mongodb/1.6.0/windows得到了最新的 mongodb dll

I extracted the dll into the c:/xampp/php/ext folder according to the instructions and restarted the server.我按照说明把dll解压到c:/xampp/php/ext文件夹,重启服务器。

I also included the extension = php_mongodb.dll in the php.ini file我还在 php.ini 文件中包含了extension = php_mongodb.dll

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.我在这里找到了一个类似的帖子PHP 无法加载动态库 (mongo.so)可以解决我的问题,但该解决方案适用于 mac 上的用户,而我在 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.原来我的 xampp 版本是 x86,所以 x64 版本的 dll 显然不起作用......解决方案是只使用 x86 版本的 dll。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复 PHP 警告:PHP 启动:无法加载动态库 'ext\\\\php_curl.dll'? - How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll'? 如何解决PHP警告:PHP启动:无法加载动态库'php_ffmpeg.dll' - How to fix PHP warning: PHP Startup: Unable to load dynamic library 'php_ffmpeg.dll' 如何修复 PHP 警告:PHP 启动:无法加载动态库“xxx/xxx/yaf.so”? - How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'xxx/xxx/yaf.so'? 警告:PHP 启动:无法加载动态库 - Warning: PHP Startup: Unable to load dynamic library 如何修复 PHP 启动:无法加载动态库? - How to fix PHP Startup: Unable to load dynamic library? PHP警告:PHP启动:无法加载动态库 - PHP Warning: PHP Startup: Unable to load dynamic library PHP警告:PHP启动:无法加载动态库Cpanel - PHP Warning: PHP Startup: Unable to load dynamic library Cpanel 警告:PHP启动:无法加载动态库[IIS和PHP] - Warning: PHP Startup: Unable to load dynamic library [ IIS and PHP ] PHP警告:PHP启动:无法加载动态库'bz2' - PHP Warning: PHP Startup: Unable to load dynamic library 'bz2' PHP警告:PHP启动:无法加载动态库不起作用 - PHP Warning: PHP Startup: Unable to load dynamic library not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM