I recently installed MongoDB on my Macbook, I installed the extension in native PHP, which I'm using along with native apache. The problem is this, if I run the Web page in Apache I get the following message:
Fatal error: Class 'MongoClient' not found in /Applications/XAMPP/xamppfiles/docs/www.alice.local/Branch/academia/public/index.php on line 6
But if I run with the command php public/index.php
I get the message as follows:
object(MongoClient)#1 (4) {
["connected"]=>
bool(true)
["status"]=>
NULL
["server":protected]=>
NULL
["persistent":protected]=>
NULL
}
PHP file:
<?php
ini_set('display_errors',1);
ini_set('display_startup_erros',1);
error_reporting(E_ALL);
$c = new MongoClient();
var_dump($c);