Fatal Error - 'Mongo' class not found

后端 未结 4 1846
再見小時候
再見小時候 2020-11-29 13:02

I\'m trying to execute this:


But I get the following error:

Fatal error: Cl

相关标签:
4条回答
  • 2020-11-29 13:38

    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

    0 讨论(0)
  • 2020-11-29 13:41

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

    0 讨论(0)
  • 2020-11-29 13:46

    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'

    0 讨论(0)
  • 2020-11-29 13:49

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

    0 讨论(0)
提交回复
热议问题