08 tháng 11 2014

PHP Driver vs Mongodb: Can not working (WAMP)



This is the first time i have installed php driver with mongodb. It make me frustrated but the problem is solved. There are 2 errors message in php_error_log i have found:

  1. 'php_mongo.dll' - The specified module could not be found.
  2. PHP Warning:  PHP Startup: mongo: Unable to initialize module.......These options need to match

The first message mean: your php driver is not correct version with mongodb. How to know the correct version? When you download a bulk of files php driver, all the file will like this:


  • php_mongo-1.5.7-5.4-vc9.dll
  • php_mongo-1.5.7-5.4-vc9-nts.dll
  • php_mongo-1.5.7-5.4-vc9-x86_64.dll
  • php_mongo-1.5.7-5.4-vc9-nts-x86_64.dll


Number "1.5.7" is the version of php driver, we don't need care about it. Next "5.4" is php version on your computer, "vc9" i guess it is build in version of php driver. The last but not least "nts" is "none theard safe", you can check your php is "thread safe" or "none thread safe" but check php[x].exe if it is "php5ts.exe" it is "thread safe" and vice versa.

So pick the correct file to install, and if you see the second message you need to try another "vc".

Good luck!!!!

Không có nhận xét nào: