为php 5.6(XAMPP)添加mongodb扩展 [英] Adding mongodb extension for php 5.6 (XAMPP)
问题描述
我在这里读过很少的文章来解决我的问题,但是都不适用于php-5.6.
我下载了 php_mongo-1.6.8.zip 和 php_mongo-1.6.7.zip ,并尝试了所有.dll扩展名,所有扩展名都给出一个或另一个错误.
错误消息:
-
PHP启动:无法加载动态库'C:\ xampp \ php \ ext \ php_mongo-1.6.8-5.6-vc11-x86_64.dll'-%1不是有效的Win32应用程序.>
在第0行的未知"中
-
PHP启动:无法加载动态库'C:\ xampp \ php \ ext \ php_mongo-1.6.8-5.6-vc11.dll'-找不到指定的模块.
在第0行的未知"中
P.S .:我在环境中使用 XAMPP .
我通过以下步骤安装了mongo扩展程序:
- 下载并安装 xampp-win32-5.6.12-0-VC11-installer.exe 到Windows 7上的
C:\xampp
- 下载 http://localhost/dashboard/phpinfo.php .好,接下来呢?
- 将
C:\xampp\php\libsasl.dll
复制到C:\xampp\apache\bin\
,重新启动Apache并享用.
此方法对我来说效果很好.我希望这将有助于解决您的问题.
I have read few post here on solving my issue but neither works for php-5.6.
I downloaded php_mongo-1.6.8.zip and php_mongo-1.6.7.zip and tried all the .dll extensions and all of them gives one or the other error.
Error message:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_mongo-1.6.8-5.6-vc11-x86_64.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_mongo-1.6.8-5.6-vc11.dll' - The specified module could not be found.
in Unknown on line 0
P.S.: I am using XAMPP for my environment.
解决方案I installed mongo extension with following steps:
- Download and install xampp-win32-5.6.12-0-VC11-installer.exe to
C:\xampp
on Windows 7 - Download http://windows.php.net/downloads/pecl/releases/mongo/1.6.11/php_mongo-1.6.11-5.6-ts-vc11-x86.zip, extract
php_mongo.dll
and copy it toC:\xampp\php\ext
- Add to
C:\xampp\php\php.ini
lineextension=php_mongo.dll
Without further configuration, I see mongo extension in command line (
C:\xampp\php\php.exe -i | findstr mongo
) but Apache complains about missinglibsasl.dll
and mongo is missing in http://localhost/dashboard/phpinfo.php. Ok, what next?- Copy
C:\xampp\php\libsasl.dll
toC:\xampp\apache\bin\
, restart Apache and enjoy.
This howto worked for me well. I hope it will help to resolve your issue.
这篇关于为php 5.6(XAMPP)添加mongodb扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 将