Fatal error: Class 'MongoDB\Driver\Manager' not found"
<p>I get the following error when trying to run a <strong>PHP</strong> script that access local <strong>MongoDB</strong>:</p>
<blockquote>
<p>Fatal error: Class 'MongoDB\Driver\Manager' not found&quot;.</p>
</blockquote>
<p>I have setup apache (2.4.23), along with PHP (5.6.25) and MongoDB (2.4.14)
and a MongoDB driver (1.1.0).
<strong>Everything seems to be working from the command line</strong> (cli), but when I try
to access the DB via the web I get an error saying &quot;</p>
<blockquote>
<p>Fatal error: Class 'MongoDB\Driver\Manager' not found&quot;.</p>
</blockquote>
<p>I am aware that php.ini has a special configuration file for apache
(/etc/php5/apache2/php.ini), and <strong>I have enabled the mongodb.so extension</strong>
there. However, I am still getting that error.
I double checked that php is actually reading the configuration from there:</p>
<blockquote>
<p>Configuration File (php.ini) Path /etc/php5/apache2 Loaded</p>
<p>Configuration File /etc/php5/apache2/php.ini Loaded</p>
</blockquote>
<p>According to the MongoDB website (
<a href="https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#reference-compatibility-mongodb-php" rel="nofollow noreferrer">https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#reference-compatibility-mongodb-php</a>),
MongoDB (2.4) is compatible with mongoDB php Driver version 1.1.
Again, from the command line, my test script works:</p>
<pre><code>&lt;?php
echo phpinfo();
    
$manager = new MongoDB\Driver\Manager(&quot;mongodb://localhost:28124&quot;);
</code></pre>
<p>Any Ideas?!?!?!?</p>