title: Neither 'MongoDB\Client' or 'MongoDB\Driver\Manager("mongodb://localhost:27017")' work
body: <p>I am trying to install the mongoDB extension for PHP with MAMP so I can potentially access my MongoDB server, and as far as I can tell, I have done everything right, yet I am still getting errors.</p>
  
  <p>I have the MongoDB extension installed - I can tell because:</p>
  
  <pre><code>$sudo pecl install mongodb
  pecl/mongodb is already installed and is the same as the released version 1.5.3
  install failed
  </code></pre>
  
  <p>Also my phpinfo shows this:</p>
  
  <p><a href="https://i.stack.imgur.com/dwy8M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dwy8M.png" alt="php mongodb extension"></a></p>
  
  <p>Also I have included the following:</p>
  
  <pre><code>var_dump(extension_loaded('mongodb'));
  echo phpversion('mongodb')."\n";
  </code></pre>
  
  <p>which have returned:</p>
  
  <pre><code>/Applications/MAMP/htdocs/mongo.php:35:boolean true
  1.5.3 
  </code></pre>
  
  <p>I also have:</p>
  
  <pre><code>$ composer require mongodb/mongodb
  Using version ^1.4 for mongodb/mongodb
  ./composer.json has been updated
  Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Nothing to install or update
  Generating autoload files
  </code></pre>
  
  <p>phpinfo tells me my php.ini file is here:</p>
  
  <p><a href="https://i.stack.imgur.com/tfmCt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tfmCt.png" alt="location of php ini file"></a></p>
  
  <p>And i have added to that:</p>
  
  <pre><code>extension=mongodb.so
  </code></pre>
  
  <p>In my PHP file I have the following:</p>
  
  <pre><code>require 'vendor/autoload.php'; // include Composer's autoloader
  $m = new MongoDB\Driver\Manager("mongodb://localhost:27017");
  //$m = new MongoDB\Client("mongodb://localhost:27017");
  
  echo "connected successfully";
  
  // select a database
  $db = $m-&gt;bob;
  echo "database selected";
  </code></pre>
  
  <p>If I try the MongDB/Client option, I get the following error:</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'MongoDB\Client' not found in /Applications/MAMP/htdocs/mongo.php on line 61
  </code></pre>
  
  <p>If I try the MongoDB/Driver option, I get the following error:</p>
  
  <pre><code>Notice: Undefined property: MongoDB\Driver\Manager::$bob in /Applications/MAMP/htdocs/mongo.php on line 52
  </code></pre>
  
  <p>A var_dump of MongoDB\Driver etc. gives the following:</p>
  
  <pre><code> /Applications/MAMP/htdocs/mongo.php:38:
   object(MongoDB\Driver\Manager)[3]
   public 'uri' =&gt; string 'mongodb://localhost:27017' (length=25)
   public 'cluster' =&gt; 
      array (size=0)
      empty
  </code></pre>
  
  <p>Is there anything I could be missing?</p>