在WAMP中找不到MongoClient [英] MongoClient not found in WAMP

查看:96
本文介绍了在WAMP中找不到MongoClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图整天在WAMP上运行MongoDB,它显示错误:致命错误:未找到MongoClient类.我有一个Windows 64位,Wamp 32位(尝试并无法运行wamp 64后),MongoDB 64位.我从 https://s3.amazonaws.com/drivers下载了mongo php_driver. mongodb.org/php/index.html .将php_mongo-1.5.1-5.4-vc9.dll复制为php扩展名文件夹,即php_mongo.dll.在php.ini(配置设置文件)中将其添加为扩展名.我的php.ini扩展部分如下所示:

I have been trying to run MongoDB on WAMP all day and It shows the error: Fatal Error: MongoClient class not found. I have a windows 64 bit, Wamp 32 bit ( after trying and failing at running wamp 64), MongoDB 64 bit. I downloaded mongo php_driver from https://s3.amazonaws.com/drivers.mongodb.org/php/index.html. Copied php_mongo-1.5.1-5.4-vc9.dll to the php extension folder as php_mongo.dll. Added it as extension in php.ini (configuration setting file). My php.ini extension section looks like this:

extension=php_bz2.dll
extension=php_curl.dll
extension=php_com_dotnet.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
extension=php_shmop.dll
extension=php_mongo.dll

我已重新启动服务器.我在phpinfo()文件上看不到Mongo,而且php错误日志文件显示以下内容:

I've reboot the server. I don't see Mongo on the phpinfo() file and also the php error log files shows the following:

c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.
 PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - %1 is not a valid Win32 application.

PHP Warning: PHP Startup: mongo: Unable to initialize module

请告诉我我丢失了什么,因为我已经尝试了所有方法.

Please tell me what I am missing because I have tried everything.

谢谢!

推荐答案

要修复php_intl.dll错误,请使用wmapmanager菜单执行以下操作

To fix the php_intl.dll error do the following using the wmapmanager menus

wampmanager -> Apache -> Version -> and click on the 2.4.9 version number

这将导致wampmanager重建\wamp\bin\apache\apache2.4.9\bin文件夹中的所有SYMLINKS.

This will cause wampmanager to rebuild all the SYMLINKS in the \wamp\bin\apache\apache2.4.9\bin folder.

关于mongo错误,确定要编辑正确的php.ini文件.

As to the mongo error, are you sure you are editing the correct php.ini file.

再次使用wampmanager菜单系统编辑正确的php.ini文件

Again use the wampmanager menu system to edit the correct php.ini file

wampmanager -> PHP -> php.ini

我希望扩展名未添加到此文件,所以添加

I expect the extension was not added to this file so add

extension=php_mongo.dll

就像处理ini文件的PHP CLI版本一样.

like you did to the PHP CLI version of the ini file.

这篇关于在WAMP中找不到MongoClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆