0

I am using lampp on linux system and I did all the configuration whatever the mognodb document says. 1) cd /usr/bin/mongod : it start mongodb server 2) /usr/bin: mongo : it shows me the commandline of mongodb where i can create new db.

but when i write php in my /opt/lampp/mongodb/upload.php and try to connect to the mongodb it always says MongoClient() class not found.

pls help .i did tried every tutorial but it just wont work.

mongodb version: 3.4.14

ThisisFish
  • 416
  • 1
  • 6
  • 14
  • You'd need to have the MongoClient extension installed for PHP, but it's apparently [deprecated](http://php.net/manual/en/class.mongoclient.php) – aynber May 17 '18 at 17:10
  • It showing me the same error. MongoDB() class not found – ThisisFish May 17 '18 at 17:12
  • You'll need the PHP MongoDB driver installed (`mongo.so` extension is the legacy/deprecated option, `mongodb.so` is the newer, currently supported option). `MongoClient()` specifically is a legacy extension class. – B. Fleming May 17 '18 at 17:13
  • You'll need to [install the extension](http://php.net/manual/en/mongodb.installation.php) – aynber May 17 '18 at 17:13
  • i downloaded php driver but i dont see any file name with mongo.so or mongodb.so also i was not able to find ext folder in lampp/php to copy those files. – ThisisFish May 17 '18 at 17:18
  • PHP Warning: Module 'mongodb' already loaded in Unknown on line 0 pecl/mongodb is already installed and is the same as the released version 1.4.3 install failed – ThisisFish May 17 '18 at 17:20
  • it gives me this error – ThisisFish May 17 '18 at 17:20
  • Please refer below link https://stackoverflow.com/questions/24533938/class-mongoclient-not-found – Chamaz May 17 '18 at 17:57
  • it still throwing the same error – ThisisFish May 17 '18 at 21:10

0 Answers0