MongoDB无法在WAMP上使用PHP [英] MongoDB not working with PHP on WAMP

查看:91
本文介绍了MongoDB无法在WAMP上使用PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直无法让MongoDB和php一起工作:

( ! ) Fatal error: Class 'Mongo' not found in C:\wamp\www\mongoDBTest\index.php on line 6

这是我的详细信息:

  • 系统:Windows NT LAPBTN1894 6.1内部版本7600(Windows 7企业版)AMD64
  • 体系结构:x64
  • Apache/PHP:Apache/2.4.4(Win64)PHP/5.4.12线程安全
  • 编译器:MSVC9(Visual C ++ 2008)
  • MongoDB:2.4.5

MongoDB本身可以正常工作,并且我已经创建了data/db文件夹.

我尝试使用文件"php_mongo-1.3.1-5.4-vc9-x86_64.dll"将php_mongo.dll添加到我的php ext文件夹中,然后重命名并将relevent扩展名添加到php.ini文件中. /p>

我也了解此网站,但没有发现任何有用的信息 http://www.php.net/manual/en /mongo.installation.php#mongo.installation.windows

解决方案

我想您已经在更改php.ini扩展名后重新启动了WAMP. 首先,尝试在环境路径中添加MongoDB并重新启动计算机(重新启动确实解决了很多问题,您会感到惊讶).

更改php.ini时,请尝试不更改DLL名称,并以下载方式添加它.

您可以点击以下内容详细查看其中的一些技巧在这里.

I have been having trouble with getting MongoDB and php working together:

( ! ) Fatal error: Class 'Mongo' not found in C:\wamp\www\mongoDBTest\index.php on line 6

Here are my details:

  • system: Windows NT LAPBTN1894 6.1 build 7600 (Windows 7 Enterprise Edition) AMD64
  • Architecture: x64
  • Apache/PHP: Apache/2.4.4 (Win64) PHP/5.4.12 thread safe
  • Compiler: MSVC9 (Visual C++ 2008)
  • MongoDB: 2.4.5

MongoDB works fine on it's own and I have created the data/db folder.

I have tried adding php_mongo.dll to my php ext folder using the file "php_mongo-1.3.1-5.4-vc9-x86_64.dll" and then renaming it and adding the relevent extension in the php.ini file.

I also know about this site and not found anything useful http://www.php.net/manual/en/mongo.installation.php#mongo.installation.windows

解决方案

I am supposing you have restarted WAMP after changing the php.ini extensions. At first, try to add the MongoDB in your ENVIRONMENT PATH and restart computer (you would be surprised by the amount of problems the restart does solve).

When changing the php.ini try either to do not change the DLL name, and add it the way you downloaded it.

You can check some of this tips in detail clicking here.

这篇关于MongoDB无法在WAMP上使用PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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