Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get MongoDB working with php 5.3.5 & wamp?

I keep receiving this error (from the apache log) and I cannot get the php_mongo.dll module loaded with the 32bit versions of both mongo and wamp.

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.5/ext/php_mongo.dll' - The specified module could not be found.\r\n in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.5/ext/php_mongo.dll' - The specified module could not be found.
in <b>Unknown</b> on line <b>0</b><br />

Whats most frustrating is the fact that I can see the file sitting in the exact directory the error message is telling me it can't find it! I've rechecked the php.ini edits were correct, but I still can't get the module to load when php starts up. Any ideas what the '\r\n in Unknown on line 0' may correspond to?

php 5.3.5 apache 2.2.17 windows 7

Thanks!

like image 748
Kiada Avatar asked Sep 16 '11 08:09

Kiada


People also ask

Can we connect MongoDB with PHP?

You can add the driver to your application to work with MongoDB in PHP. The MongoDB PHP Driver consists of the two following components: The extension , which provides a low-level API and mainly serves to integrate libmongoc and libbson with PHP.


1 Answers

Make sure you use the thread safe version of the mongodb extension plugin. I stumbled upon the exact same errors while using the non-thread-safe versions.

To download the right extension, see: http://www.php.net/manual/en/mongo.installation.php#mongo.installation.windows

Most likely you'll need the VC9 (Thread Safe) version.

like image 180
Wilbert Avatar answered Nov 07 '22 06:11

Wilbert