简体   繁体   中英

MongoDb not found in ZF2 controller

I have few controllers in my zf2 project which work perfectly in the browser using apache and via command line.

However, I recently installed MongoDb so I can store some data using the driver found in ( http://php.net/manual/en/set.mongodb.php )

My issue is, when I try to access the driver via controller + browser, I get the following message error in my apache logs :

PHP Fatal error: Class 'MongoDb\\Driver\\Manager' not found. 'MongoDb\\Driver\\Manager' is the namespace for this Driver.

If I execute some other controllers via command line, MongoDb works correctly.

Does anyone know why is this happening? I cannot see the issue :(

Thank you

I found that my php.ini was pointing to mongo.so instead of mongodb.so

That fixed the issue http://php.net/manual/en/mongodb.installation.manual.php

Thank you for your help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM