Fatal Error - 'Mongo' class not found

馋奶兔 提交于 2019-11-27 02:14:53

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

Sina Miandashti

If this problem exist in php CLI you should add extension=mongo.so to your /etc/php5/cli/php.ini file

Check out the exact compiler name of your PHP binary in phpinfo page and try to reinstall the mongo driver was built on same compiler.

http://www.php.net/manual/en/mongo.installation.php#mongo.installation.windows

You're using the mongo driver was bulit on Visual Studio 6 with Thread-safe, now. ( vs6ts means it )

Similar problem was caused by compiler issue;

http://www.php.net/manual/en/mongo.installation.php#104223

On Ubuntu, I used this tutorial . Once installed, echo the phpinfo() and check if the mongo.ini file is located in the correct directory mentioned in phpinfo with 'Scan this dir for additional .ini files'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!