Komol Chandra Devnath
Komol Chandra Devnath

Reputation: 29

mongodb/laravel-mongodb Package Integration Problem

Introduction

i try to using monodb database with laravel 10

Environment Details

what i update

sudo pecl install mongodb

Update php.ini

extension=mongodb.so

Error List

Problem 1

  - mongodb/laravel-mongodb is locked to version 4.2.0 and an update of this package was not requested.

  - mongodb/laravel-mongodb 4.2.0 requires ext-mongodb ^1.15 -> it has the wrong version installed (1.12.0).

  Problem 2

  - mongodb/mongodb is locked to version 1.17.1 and an update of this package was not requested.

  - mongodb/mongodb 1.17.1 requires ext-mongodb ^1.17.0 -> it has the wrong version installed (1.12.0).

Upvotes: 0

Views: 424

Answers (1)

Eyad Bereh
Eyad Bereh

Reputation: 1746

It seems that you have an old version of the PHP's MongoDB extension, so you need to update it.

To update this extension, you have to run the following command on your terminal:

sudo apt install php8.1-mongodb

This way, your MongoDB extension will be updated to the latest version (which is 1.17.3, at the time of writing this answer)

Side note: PHP 8.1 is no longer actively supported, currently it's only accepting critical security fixes, and in November it will reach its end-of-life stage, so it's highly recommended that you update to version 8.2 or 8.3.

Upvotes: 0

Related Questions