Unsupported driver [mongodb] : Laravel 7 & PHP 7.4

165 Views Asked by At

I am using Laravel 7 with MongoDB. I already installed mongo using

https://www.php.net/manual/en/mongodb.installation.pecl.php

The package used is:

https://github.com/jenssegers/laravel-mongodb

This is the error i get when running migration or queries:

Unsupported driver [mongodb]

This is the response i get when accessing php.info file

Mongodb extension detail of php 7.4 Reference Image

I've followed the solution provided in the question Link and also the followed the official php documentation Link.

I need to solve the issue that is occurring and should be able to connect to the mongodb using the laravel and ubuntu server.

1

There are 1 best solutions below

0
Evg Vfv On

Drivers are loaded from the appropriate files in the config/...php directory. You need to check that you have the settings for Mongo in the required section. If everything is written that you need to run

php artisan cache:clear
php artisan config:clear

These commands will clear the cached configurations and the new driver should work.