简体   繁体   English

PHP无法连接到Mongodb

[英]PHP can't connect to Mongodb

I followed the windows installation instructions in mongodb's website but I still can't connect to MongoDB through PHP because of this error: 我按照mongodb网站上的Windows安装说明进行操作,但是由于此错误,我仍然无法通过PHP连接到MongoDB:

Class 'Mongo' not found 找不到“ Mongo”类

Why isn't the file containing the Mongo Class not being loaded? 为什么没有加载包含Mongo类的文件?

I've also found this error: 我也发现了这个错误:

PHP Warning: PHP Startup: mongo: Unable to initialize module Module compiled with module API=20090626, debug=0, thread-safety=1 PHP compiled with module API=20060613, debug=0, thread-safety=1 These options need to match in Unknown on line 0 PHP警告:PHP启动:mongo:无法初始化模块使用模块API = 20090626编译的模块,调试= 0,线程安全= 1使用模块API = 20060613编译的PHP,调试= 0,线程安全= 1这些选项需要在第0行的“未知”中匹配

I'm using php 5.2.5 and the mongo-php-driver is Windows PHP 5.2 VC6 thread safe 我正在使用php 5.2.5,mongo-php-driver是Windows PHP 5.2 VC6线程安全的

Thanks 谢谢

The driver was compiled for php 5.3 though the name suggests otherwise. 该驱动程序是为php 5.3编译的,尽管名称另有说明。
Can you upgrade to php 5.3(.2) ? 您可以升级到php 5.3(.2)吗?

在archlinux上,安装php-mongo 1.2.10-1为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM