I just can't seem to find any clear instructions on how exactly you do that for PHP 7 running on a machine with Windows 7 installed. I tried a couple of online tutorials, but nothing seems to have worked out for me so far. It's possible that some of you may have had an experience similar to mine and it would be absolutely wonderful if you could share that experience with me: specifically, what exactly you did in order to to get this issue resolved.
Here's what I did:
I downloaded the latest dll library for PHP 7 (mongodb-1.1.2.tgz) from here: PECL :: Package :: mongodb :: 1.1.2, placed the file php_mongodb.dll from the archive into the ext directory where I keep my PHP installation, added the line extension=php_mongodb.dll to the php.ini file (after all these steps, Apache was restarted, of course). The section for mongodb does show up as a result of running the phpinfo() function:
And now I'm trying to run this simple script:
<?php
$connection = new MongoClient();
?>
And what I get back is the following error (I have broken the lines a little bit for better readability):
Fatal error: Uncaught Error: Class 'MongoClient' not found in
C:\Apache24\htdocs\test2.php:3 Stack trace: #0 {main} thrown in
C:\Apache24\htdocs\test2.php on line 3