PHP cannot access MongoDB, you need to install the Mongo extension for PHP

853 Views Asked by At

I am new to Ubuntu and I want to use mongodb. I have installed mongodb using the command

sudo pecl install mongodb

It is working fine and showing running status. Now I want to use moadmin but when I open it in a browser, it shows me the message below.

PHP cannot access MongoDB, you need to install the Mongo extension for
PHP.

I also added extension=mongodb.so in php.ini which was located in cli and apache2 folder. I am still seeing the same message from moadmin.php.

1

There are 1 best solutions below

1
On

you have to install mongo php extension with this command:

sudo apt-get install php-mongodb