We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Unable to connect MongoDB with PHP 7, facing driver issue

Hello Guys

I am using php7 with mongodb 3.4 but i am unable to connect with php. There is no connection driver to connect. Can you please help to get it connect. I need help on urgent basis.

Thanks !!!

You need to use mongodb collection from incubator. Le posted wrong link:

https://github.com/phalcon/incubator/tree/master/Library/Phalcon/Mvc

You need to use MongoCollection class and install of course proper extension for php.



43.9k

so, is Phalcon\Db\Adapter\MongoDB\Client as found here useless ?

I guess you need to use both.



43.9k

maybe @aipdtech will tell us more about that. I've used mogoDB with phalcon v2 but have no experience with v3 ....



2.1k

maybe @aipdtech will tell us more about that. I've used mogoDB with phalcon v2 but have no experience with v3 .... Hello @le51 we are working with phalcon version 3 and mongoDB 3.4.

First, you need to make sure that your PHP can connect to MongoDB instance. https://php.net/manual/en/set.mongodb.php

Since Phalcon does not support new driver yet, you'd need to either use incubator community port as posted here, or to build your own ODM layer, or to simply use native PHP methods.