I am trying to connect PHP 7 to mongoDB, I installed the βnewβ MongoDB driver using pecl by doing the following pages . I can see MongoDB version 1.1.8 version from phpInfo() , but I cannot figure out how to initiate a connection from PHP code: p. The following code includes my connection attempts (tried to connect even using the old method)
// new fashion way $connection = new MongoDB\Driver\Client(); // or by using old fashion way $conn = new MongoClient(); // random try :p $randConn = new MongoDB\Client();
and in both cases I get an exception class exception. please let me know what I am missing and where is my mistake, please provide an example to make it easier to follow if possible;).
PS: the operating system used is ubuntu 14.04 LTS.
early.
source share