Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
problem with create MongoDB instance
  • Hello,
    I'm trying to use MongoDB with FuelPHP.
    When checking php setting with phpinfo, every things look good (Mongo extension is enable)
    However when trying
    $mongodb = \Mongo_Db::instance();

    Exception: The MongoDB PECL extension has not been installed or enabled appears.
    I'm using newest Fuel 1.8 and php 7.0.9
    Any idea with this?
  • HarroHarro
    Accepted Answer
    There are two PHP exensions for Mongo, the "mongo" PECL extension (which is now deprecated) and the new "mongodb" extension.

    Fuel uses the older extension, and I assume you have the new one installed, which is not supported at the moment. It has a completely different API, so using it requires rewriting the Mongo_Db class.
  • You might be able to get it to work using this Composer package:

  • Hello Harro, it worked with the old mongo PECL extension. Thanks so much for your support!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion