title: PHP Fatal Error: Class 'MongoClient' not found
body: <p>I have a site using Apache that is just the following code:</p>
  
  <pre><code>&lt;?php $m = new MongoClient(); ?&gt;
  </code></pre>
  
  <p>and when I try to access it, I get the error in error.log</p>
  
  <pre><code>`PHP Fatal Error: Class 'MongoClient' not found`
  </code></pre>
  
  <p>The following are settings which might be wrong, but I don't think are.</p>
  
  <p><code>php -i | grep 'Configuration'</code> => <code>Configuration File (php.ini) Path =&gt; /etc/php5/cli | Loaded Configuration File =&gt; /etc/php5/cli/php.ini</code></p>
  
  <p><code>grep 'mongo' /etc/php5/cli/php.ini</code> => <code>extension=mongo.so</code></p>
  
  <p><code>php -i | grep 'extension'</code> => 
  <code>extension_dir =&gt; /usr/lib/php5/20121212 =&gt; /usr/lib/php5/20121212</code></p>
  
  <p><code>ls /usr/lib/php5/20121212/ | grep 'mongo.so'</code> => <code>mongo.so</code></p>
  
  <p>I haven't been able to find anything to suggest I installed it wrong or have it wrongly configured. I installed it within the past two hours using <code>pecl</code> and <code>pear</code> (<code>sudo pear install -f pecl/mongo</code> and <code>sudo pecl install mongo</code>)</p>
  
  <p>I've restarted my Apache and even my computer multiple times.</p>
  
  <p>So why am I getting the error <code>Class 'MongoClient' not found</code>?</p>
  
  <p>I'm on Ubuntu. PHP version 5.5. </p>
  
  <p>Edit: I've just discovered that MongoClient is valid when I run php in interactive mode. Perhaps it has to do with a user permission/user installation issue?</p>