致命错误 - “蒙戈”类未找到 [英] Fatal Error - 'Mongo' class not found

查看:262
本文介绍了致命错误 - “蒙戈”类未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图执行此:

 < PHP//连接
$ M =新蒙戈();?>

不过,我得到以下错误:


  

致命错误:类'蒙戈'没有发现在C:\\ WAMP \\ WWW .....



信息:


  • PHP:5.38

  • 的MongoDB:MongoDB的-Win32的i386-2.0.2

  • MongoDB的PHP驱动程序:蒙戈-1.1.4-php5.3vc6ts

  • WampServer:2.2

  • 操作系统:Windows 7 SP1企业

我已经试过了MongoDB的安装罚款(包括添加DLL为EXT和放大器; php.ini中),我已经开始mongod.exe和WAMP运行

这意味着什么是缺少/不正确的?


修改

我已完成了另一个Windows 7计算机(Windows 7的Profressional)上运行。这让我好奇。所以,现在我的Windows 7企业版SP1机具有相同的的http.conf 的php.ini C:\\ WAMP \\ BIN \\ MongoDB的的内容(数据块,因此是完全一样的),并完全相同的批处理文件来启动 mongod.exe 作为我的Win7专业版的机器。

但尽管如此,我可以我的Win7 SP1企业的机器上做的是通过命令行连接。我的Win7专业版机的的phpinfo()载:结果

我的Win7 SP1企业设备不包含对MongoDB的任何引用。

我使用MongoDB的启动批处理文件的内容:

 C:\\ WAMP \\ BIN \\ MongoDB的\\ BIN \\ mongod.exe--logpathC:\\ WAMP \\ BIN \\ MongoDB中的\\ logs \\ error.log中--logappend --dbpathC:\\ WAMP \\ BIN \\ MongoDB的\\ DATA \\ DB--directoryperdb --service
NET START的MongoDB
暂停


解决方案

的问题是PHP驱动程序( php_mongo.dll )。阿帕奇/ WAMP只是不喜欢的蒙戈-1.1.4-php5.3vc6ts 版本的某些原因。我的Windows 7专业版的机器有蒙戈-1.2.5-php5.3vc9ts 版本。这是两台机器之间的唯一区别。

我原本一直使用蒙戈-1.2.5-php5.3vc9ts 版本的Windows 7企业版的机器上的驱动程序,但改为蒙戈-1.1.4-php5.3vc6ts 当我排除故障的版本。所以原来的问题可能实际上只是一直数据库路径数据\\分贝不存在/未找到(并在需要使用指定 - DBPATH 运行时/启动 mongod.exe

I'm trying to execute this:

<?php

// connect
$m = new Mongo();

?>

But I get the following error:

Fatal error: Class 'Mongo' not found in C:\wamp\www.....


Info:

  • PHP: 5.38
  • MongoDB: mongodb-win32-i386-2.0.2
  • MongoDB PHP Driver: mongo-1.1.4-php5.3vc6ts
  • WampServer: 2.2
  • OS: Windows 7 Enterprise SP1

I've followed the MongoDB installation fine (incl. adding the DLL to ext & php.ini), I've started mongod.exe and WAMP is running.

What does this imply is missing/incorrect?


Edit:

I have got it running on another Windows 7 machine (Windows 7 Profressional). That got me curious. So now my Windows 7 Enterprise SP1 machine has the same http.conf, php.ini, C:\wamp\bin\mongodb contents (therefore DBs are the exact same) and the exact same batch file to start mongod.exe as my Win7 Professional machine.

But still, all I can do on my Win7 Enterprise SP1 machine is connect via command line. My Win7 Professional machine's phpinfo() contains:
My Win7 Enterprise SP1 machine doesn't contain any reference to MongoDB.

The contents of the batch file I use to start MongoDB:

"C:\wamp\bin\mongodb\bin\mongod.exe" --logpath "C:\wamp\bin\mongodb\logs\error.log" --logappend --dbpath "C:\wamp\bin\mongodb\data\db" --directoryperdb --service
Net Start "MongoDB"
pause

解决方案

The problem was the PHP driver (php_mongo.dll). Apache/WAMP just did not like the mongo-1.1.4-php5.3vc6ts version for some reason. My Windows 7 Professional machine had the mongo-1.2.5-php5.3vc9ts version. That was the only difference between the two machines.

I originally had been using the mongo-1.2.5-php5.3vc9ts version of the driver on the Windows 7 Enterprise machine but changed to the mongo-1.1.4-php5.3vc6tsversion when I was troubleshooting the problem. So the original problem could actually just have been that the database path data\db didn't exist/couldn't be found (and needed to be specified using --dbpath when running/starting mongod.exe).

这篇关于致命错误 - “蒙戈”类未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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