dongzhuo8210 2012-08-19 16:50
浏览 80
已采纳

MongoDB,Windows 7,XAMPP,PHP.ini

I am having a lot of trouble getting XAMPP to work with MongoDB on Windows 7.

I'm using XAMPP 1.7.7/PHP 5.3.8.

I have MongoDB setup properly and can query via a shell (and MongoD.exe is running).

But whenever I try to access MongoDB via a PHP script, I get the error (via CodeIgniter):

The MongoDB PECL extension has not been installed or enabled

It does NOT show MongoDB in the extensions when I run phpinfo(). However, I've used the drivers located here https://github.com/mongodb/mongo-php-driver/downloads and added the appropriate lines to php.ini

It seems to me that the server isn't actually reading php.ini. I have tried every version of the 5.3 driver in that zip file and it never loads. There are also no errors in the PHP error log OR the Apache error log.

phpinfo() says it's using the following php.ini files:

> Configuration File (php.ini) Path C:\Windows 
> Loaded Configuration File C:\xampp\php\php.ini

There is NOT a php.ini file in C:\Windows. The only php.ini that exists on my machine is in C:\xampp\php\php.ini and modifying it seems to have absolutely no effect. Even if I put extension=norealfilename.abc, it doesn't throw an error, which seems odd.

I'm totally at a loss here and I've lost several days trying to get this going and am beyond frustrated. Any help would be appreciated.

Other relevant phpinfo() information: System Windows NT MY-PC 6.1 build 7601 (Windows 7 Home Premium Edition Service Pack 1) i586 Compiler MSVC9 (Visual C++ 2008) Architecture x86 Thread Safety enabled

If you need more information let me know and I will update this question.

  • 写回答

2条回答 默认 最新

  • dongwolu5275 2012-08-19 17:06
    关注

    I did the following (to use with Codeigniter):

    Downloaded from https://github.com/mongodb/mongo-php-driver/downloads

    *Careful to get the thread-safe version.

    Then add this line in your php.ini file:

    extension=php_mongo-1.2.11-5.3-vc9-x86_64.dll (or whatever version did you download)

    Then restart your server and check the error log to see if there are any errors/conflicts.

    PS: I use WAMP!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 fx2n系列plc的自控成型机模拟
  • ¥15 时间序列LSTM模型归回预测代码问题
  • ¥50 使用CUDA如何高效的做并行化处理,是否可以多个分段同时进行匹配计算处理?目前数据传输速度有些慢,如何提高速度,使用gdrcopy是否可行?请给出具体意见。
  • ¥15 基于STM32,电机驱动模块为L298N,四路运放电磁传感器,三轮智能小车电磁组电磁循迹(两个电机,一个万向轮),如何通过环岛的原理及完整代码
  • ¥20 机器学习或深度学习问题?困扰了我一个世纪,晚来天欲雪,能饮一杯无?
  • ¥15 c语言数据结构高铁订票系统
  • ¥15 关于wkernell.PDB加载的问题,如何解决?(语言-c#|开发工具-vscode)
  • ¥100 某宝多次访问被拒绝,求解
  • ¥15 (标签-STM32|关键词-智能小车)
  • ¥20 关于#stm32#的问题,请各位专家解答!