Fatal error: class "Mongo" not found in xampp

I am using Windows 7 64-bit with XAMPP for Windows and cannot find a solution for the installation problem. I have looked through the guides for installing Windows and PHP drivers in MongoDB.

From PHP info my environment specs: XAMPP 1.7.4 PHP: 5.3.3 Apache 2.0 Handler

Does anyone have any idea how to finish the installation? I read many comments about people and tried various troubleshooting and workarounds, but nothing came to me.

I follow these steps:

  • Downloading drivers from the official site
  • Stopping all services
  • PHP.ini update
  • Restarting all services

Shows:

Fatal error: class "Mongo" not found in G: \ Project \ xampp \ htdocs \ Mongo \ mongo.php on line 2

Anyone can solve the problem.

+3


source to share


3 answers


You don't have the mongo extension downloaded.

Have you already followed the installation instructions for the letter? Do you already have mongodb installed ?

If you can't connect to mongo at all (by typing mongo

dos at the prompt), you'll need to access it first.



If you can connect to mongo but not via php, the step will be skipped, but most likely:

  • open php.ini file
  • make sure it has extension=php_mongo.dll

    (or the appropriate conf file)
  • restart apache
  • try again
+2


source


I know this is really old, sorry for reviving, I'm only reviving because it helps me think and solve my problem in WAMP.

To get things to work, you need to set the mongo program (not mongod) to the system PATH, as you do when you install Java.

If you use the mongo program in "C: \ data \ mongodb \ bin", you open the PATH variable and end with a semicolon in the mongo folder, for example: "; C: \ data \ mongodb \ bin".



Open cmd command and try running C: \ Users \ Yourname> mongo If it works, you have successfully "installed" mongo, you know, you only need to update php.ini and restart xampp or wamp. Make sure you have installed dll driver in EXT folder for PHP installation. "C: \ wamp \ bin \ php \ php5.4.3 \ ext" for WAMP.

Sorry bad english, I only answer because I have the same problem and it helps me.

+1


source


Have a look at this answer, it helped me a lot.

PHP MongoDB: Fatal error: Class 'MongoClient' not found

Apparently the MongoClient class is deprecated, so the old code won't work. I am trying to follow the tutorials -> and they are using the new MongoClient () code, but since I am running php version 7 and the corresponding mongo dll, this code will not work.

Time to look for an updated tutorial.

0


source







All Articles