Recently I upgraded my Wamp server from Wamp 2.5 to Wamp 3.0 succesfully. Now, in my Wamp 3.0 server, PHP is at version 5.6.31.
I downloaded the MongoDB driver (stable version 1.2.10) from https://pecl.php.net/package/mongodb, and installed it successfully into my Wamp server. The server shows mongodb as one of the loaded extensions.
I encountered an error message: Fatal error: Class 'MongoClient' not found in C:\wamp64\www\loginNew.php on line ...
That PHP code ran perfectly in the previous version of Wamp (and PHP). Here is the code
// connect to mongodb
$m = new MongoClient();
// select a database
$db = $m->ConsentForm;
$collection = $db->ConsentFormDetail;
$agreeBoolean = $_POST['agree'];
$nameInitial = $_POST['initial'];
$informedBoolean = $_POST['informed'];
$email = $_POST['emailAddress'];
$consentForm = array(
"agreeBoolean" => $agreeBoolean,
"nameInitial" => $nameInitial,
"timeOfSigning" => date("Y-m-d H:i:s"),
"informed" => $informedBoolean,
"email" => $email
);
$collection->insert($consentForm);
echo "You have Successfully Signed the consent form.....";
?>
After some search, I replaced
$m = new MongoClient();
with
$m = new MongoDB\Driver\Manager("mongodb://localhost:27017");
Then the following error message occured: Notice: Undefined property: MongoDB\Driver\Manager::$MergedParticipant in C:\wamp64\www\loginNew.php on line ...
Can you please help,
Many thanks