0

My machine is Windows 10, I am running PHP 7.3.12 on Xampp.

I have installed MongoDB extension and added it to php.ini as well.

Now when I run php -m|grep mongo, it shows MongoDB on the terminal.

When I run php -i on the terminal, it shows that MongoDB extension is enabled.

However, whenever I load phpinfo(), it does not show MongoDB extension there.

I installed jenssegers/mongodb for my laravel7 app.

But the app is showing the following error:

    "Class 'MongoDB\\Driver\\Manager' not found"

I have tried almost all the solutions that are suggested so far. Nothing worked.

What am I missing?

Derek Wang
  • 10,098
  • 4
  • 18
  • 39
Scarecrow
  • 66
  • 6
  • Nope. Tried all solutions suggested here. My confusion here is, I get mongodb extension enabled from terminal. But why my phpinfo is not displaying mongodb ext? There is no version mismatch issue for sure. – Scarecrow Oct 16 '20 at 07:02
  • 2
    Please share more details. Which extension did you install? Mongo or MongoDB? Have you checked whether it is enabled in the php.ini which is used for your webserver? This is often a different one than that used for the shell – Nico Haase Oct 16 '20 at 07:04
  • It looks like your CLI is using a different PHP configuration than your web server. It's a similar situation to https://stackoverflow.com/questions/42909397/laravel-5-4-on-php-7-0-pdo-exception-could-not-find-driver-mysql/42925908#42925908 – apokryfos Oct 16 '20 at 07:07
  • Installed mongodb ext from here: https://pecl.php.net/package/mongodb/. Both the shell and webserver are using the same php.ini. – Scarecrow Oct 16 '20 at 07:07

1 Answers1

1

After restarting the xampp several times. Phpinfo() still didn't show mongo ext enabled.

Restarting the OS solved it.

Scarecrow
  • 66
  • 6