2

I am trying to use CIMongo Library for codeigniter to use php and mongo But I am getting err:The MongoDB PECL extension has not been installed or enabled But I installed everything correctly - pecl install mongodb apt-get install php-mongodb

Will be greatful for any help Thanks in advance

zeus
  • 244
  • 3
  • 12

2 Answers2

1

For the windows users who end up here after googling "The MongoDB PECL extension has not been installed or enabled". (May be other OS users having the same issue also can grab some clues from here):

First of all thanks simon for his answer here

Previous codeigniter versions used the php_mongo.dll (mongo pecl) which you can download from here

Below is how earlier versions check for the existence of the Mongo extension.

if(!class_exists('Mongo'))
{
    $this->_show_error('The MongoDB PECL extension has not been installed or enabled', 500);
}

But newer codeigniter version looks for php_mongodb.dll (mongodb pecl) which is you can download from here

Below is how newer versions check for the existence of the Mongo extension.

if (!class_exists('MongoDB\Driver\Manager')) {
   show_error("The MongoDB PECL extension has not been installed or enabled", 500);
}
MudithaE
  • 577
  • 5
  • 6
  • I don't exactly know why I got this error but after I deleted and regenerated by `composer.lock` file the error was resolved – zeus May 26 '17 at 09:31
0

i had also got this error.. I use Bellow sollution, that works for me.

https://servertroubles.blogspot.in/2012/05/configuring-mongodb-from-php-and-xampp.html?showComment=1475216457950#c4755324682340768979

  • This answer is only available for Windows users. I would like some help, I'm currently facing the same PECL error, I'm using Debian with NGINX, PHP7 and CI 3.x – gZ Fab Feb 10 '17 at 17:01