No releases available for package "pecl.php.net/mongodb"

Viewed 1514

I want to use mongodb in laravel project. so I tried to install mongodb driver for php by running this command pecl install mongodb on cmd but I got this answer

No releases available for package "pecl.php.net/mongodb" install failed

what should I do?

3 Answers

If you are on a windows machine, go to the official pecl website: https://pecl.php.net/package/mongodb then click on the DLL link for your version of choice.

On next page scroll down and download the one matching your PHP version.

Then you should extract the zip file and copy the php_mongodb.dll to your php/ext dir. Then open your php.ini and add the following line:

extension=php_mongodb.dll

This happened to me because for some minutes, the PECL repositories were not accessible. The error was happening both on CI an my local (both on Linux) and after some minutes, it got fixed without any action from my side.

I was also facing the same problem. You can just write the following line in your command line(This will work on Mac):

$ sudo pecl install mongodb
Related