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条)

报告相同问题?

悬赏问题

  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥60 许可证msc licensing软件报错显示已有相同版本软件,但是下一步显示无法读取日志目录。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系