php - PHP Startup: Unable to load dynamic library 'php_mongodb.dll'
问题描述
I'm trying to get Laravel MongoDB working in my local machine (Windows 10 home, x64) by following this tutorial
- I have installed XAMPP 7.3.11 on
D:\xampp
succesfully and tested that the server can be reached (enterlocalhost:80
on browser) I proceeded on extracting
php_mongodb.dll
I got from pecl(mongodb 1.6.0 for Windows, 7.3 Non Thread Safe, x64 ) onD:\xampp\php\ext
and add the lineextension=php_mongodb.dll
on the fileD:\xampp\php\php.ini
After selecting 'the command-line PHP you want to use' to
D:\xampp\php\php.exe
, the setup then gave the following output:The PHP exe file you specified did not run correctly: D:\xampp\php\php.exe
The php.ini used by your command-line PHP is: D:\xampp\php\php.ini
A setting in your php.ini could be causing the problem: Either the 'extension_dir' value is incorrect or the dll does not exist.
Program Output: PHP Warning: PHP Startup: Unable to load dynamic library 'php_mongodb.dll' (tried: D:\xampp\php\ext\php_mongodb.dll (The specified module could not be found.), D:\xampp\php\ext\php_php_mongodb.dll.dll (The specified module could not be found.)) in Unknown on line 0
Commenting out the line extension=php_mongodb.dll
will execute D:\xampp\php\php.exe
without any warning. But I would need php to be aware of php_mongodb.dll
during composer installation, right?
So how to resolve this problem? The file definitely exists in the folder, and the required modification on php.ini
has been provided.
I have already looked around and some people mentioning the path in extension_dir
must be written in full path. But I have already checked that the line on my php.ini
is extension_dir="D:\xampp\php\ext"
解决方案
Problem resolved.
Cause: I was using Non Thread Safe php_mongodb.dll
, while the PHP installed by XAMPP is a Thread Safe one.
After replacing php_mongodb.dll
with the thread safe version, there's no error and I can successfully completed composer installation.
推荐阅读
- pyspark - 在 Azure Databricks 中使用 spark 流将数据加载到 azure blob
- excel - 将表格粘贴到电子邮件中时出现运行时错误 4605
- javascript - React App 在两个地方使用相同的函数,但 API 调用不同。我如何强制它每次都使用root?
- powershell - Powershell - Get-ChildItem 通配符
- upgrade - 产品不兼容:固件适用于 IDG - Datapower
- jquery - datepicker 不是一个函数 bootstrap-datepicker Symfony, webpack
- php - 将类添加到 Opencart 操作文件
- ios - ParentWidget 的使用不正确。展开的小部件必须放在 flex 小部件内
- python - django 应用程序在 docker 上找不到 mysql 数据库
- php - 将 array_column 与 preg_match 结合使用