Reputation: 36
I am trying to use mongo db database so I try to install the mongo db and I done with installation part.Now I have to work with php so I followed the steps mention on mongodb site and php manual also I placed the dll file in php/ext folder and made changes in php.ini file i.e. I put "extension=php_mongo.dll" as explained in documentations and also I restarted the web server but it still not working.My phpinfo not showing support for mongo also "MongoClient" class not found. I checked the versions of php and driver everything is correct still I canot use the mongo.
Any help will highly appreciated. Thanks.
Upvotes: 0
Views: 2985
Reputation: 80
After you place the correct .dll file in to the ..php/ext folder, In order for this extension to work, there are DLL files that must be available to the Windows system PATH. You can try that by adding your PHP directory to the PATH on Windows.
Follow below steps and check if it works :
Now try running the below php code in in localhost/"path to your .php file" (e.g. C:\xampp\htdocs\mongo-demo\demo.php) and check if it runs without any error:
<?php
// connect to mongodb
$m = new MongoClient();
echo "Connection to database successfully";
// select a database
$db = $m->mydb;
echo "Database mydb selected";
?>
Upvotes: 1
Reputation: 6922
Since GitHub no longer allows repositories to host binaries, Windows releases of the PHP driver are now hosted on S3, with links provided in the release announcement threads on the mongodb-announce mailing list. The most recent release (at the time of this writing) is 1.3.6, which you can find in this thread.
I would definitely recommend upgrading your driver, as the version you cited above is only a release candidate. Once you have the most recent driver, either of the following threads should be helpful on getting up and running with XAMPP:
Upvotes: 0