3
I recently installed in my Macbook Mongodb, I installed the extension in native PHP, which I am using together with native apache. The problem is this, if I run the web page on 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 execute with command php public/index.php
I receive 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);
What do you mean by " did I install the extension in native PHP"? Also, you made some changes in some
php.ini
?– felipsmartins
he automatically created a file called Mongo.ini. I did the native PHP installation because Mac Os already comes with PHP and Apache natively.
– Pedro Soares