I’m probably doing something silly here but I’ve been trying to install the mongodb php client on my windows VM running WAMP for a while and I’ve gotten nowhere.
I’m running WAMP 64 bit with PHP 5.4.3. I downloaded the 1.3.2RC1 zip from here and I extracted the php_mongo-1.3.2RC1-5.4-vc9.dll file into wamp/bin/php/php5.4.3/ext and then edited the php.ini file to include the new extension.
I restart WAMP and everything is fine, then when I try and use some of the code from the php mongo driver tutorial it says the MongoClient class cannot be found:
Fatal error: Class 'MongoClient' not found in C:\wamp\www\mongo\test.php ...
The code is simple but for completeness I’ll include it:
<?php
$m = new MongoClient("the-connection-string-im-using");
?>
Am I missing something? Should I just be able to create a new instance of the MongoClient like above or do I need to do something else?
Cheers
James
I figured it out – I was using the wrong php.ini file. I should have been using the one in the apache directory (C:\wamp\bin\apache\apache2.2.22\bin).
Silly.