douqian1975 2015-08-07 10:08
浏览 73
已采纳

致命错误:在Windows7 64位上的wamp中找不到类MongoClient

I download and install the MongoDB-3.0.5 from its official website and then I using the Robomongo for the easy interface and then MongoVUE for the importing and exporting the old Mysql database because it helps a lot in a easy way for importing the old database. I imported my old Database from MongoVUE tool is goes very good.

I am using wampp server for the connectivity of the PHP interface. I am using PHP version 5.5 The driver of PHP which I am using for connection was downloaded form this link.

There are many files on the link. I chose "php_mongo-1.6.8.zip". When I extracted files which are in .dll format I chose "php_mongo-1.6.8-5.5-vc11.dll" and copy to "C:\wamp\bin\php\php5.5.12\ext" this directory and then rename above .dll file to "php_mongo.dll" and open the "php.ini" file in notepad and in the end of all extensions I wrote "extension=php_mongo.dll" after saving I click on "Restart all Services" in wamp portal. After doing all this when i m going to run my PHP file it shows this Fatal error: Class MongoClient not found and then i used the "php_mongo-1.6.8-5.5-vc9.dll" and copied it to above directory and rename it to "php_mongo.dll". but there is still same error.

  • 写回答

2条回答 默认 最新

  • doushi1960 2015-08-07 10:52
    关注

    I figured out the solution of my problem there were mainly 2 reasons for this error in my system.

    1. There was IIS web server running at same time.
    2. I was using wrong .dll file from the wrong link.

    What I done for overcoming this error is as follows if any one has same issue please watch out my steps.

    1. Uninstall IIS web server, web deploy 3.5 and all there components
    2. Uninstall MongoDB, Robomongo & Wamp server
    3. Restart PC
    4. Install only Mongodb 3.0.5 with default setting and options
    5. Create data\db in C:\ drive
    6. Run mongod.exe file, when in command prompt window it shows that "waiting for connection" (You are doing well). Don't close it kept it running.
    7. Install Wamp server and after installation don't launch it (if it is, exit it completely)
    8. Use this Link for the downloading for the driver files.
    9. I m using PHP 5.5 with 64-bit Windows that's why I clicked on "5.5 Thread Safe (TS) x64"
    10. After downloading and extracting copy file "php_mongo.dll" to the "C:\wamp\bin\php\php5.5.12\ext"
    11. Open php.ini in notepad from "C:\wamp\bin\php\php5.5.12" and add "extension=php_mongo.dll" in the end of collection of extensions. (Don't use semi colon before it)
    12. After saving and closing notepad open Wamp services and run your PHP file.
    13. This time it will be OK.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制