I managed to run MongoDB on Codeigniter using Alex Bilbie` library. The operations go well (connection, queries etc. ) but sometimes I get these PHP notices:
Message: Mongo::__construct() [mongo.--construct]: localhost:27017: pool get (0x4bfab20)
Filename: libraries/Mongo_db.php
Line Number: 1274
A PHP Error was encountered
Severity: Notice
Message: Mongo::__construct() [mongo.--construct]: localhost:27017: found in pool (0x4bfab20)
Filename: libraries/Mongo_db.php
Is there a way to get rid of these? or maybe hide them..as they don’t seem to mess up my pages in another way than splashing into the user’s screen.
EDIT
On a few pages though, I use the JQgrid and when the errors show up they mess up my HTTP response and render some messy data.
The specific notice messages here have been removed in the MongoDB PHP driver 1.2.11 or later (see PHP-431). Upgrading your MongoDB driver to the latest should remove the excessive notice logging.
General notes on proper settings for Code Igniter logging in production still apply…
The
E_NOTICElevel of error reporting is intended to warn you about possible bugs or typos. It is typically only used as a development setting rather than for production messages.The default error_reporting setting in PHP4 and PHP5 is actually set to ignore these:
The Code Igniter
index.phphas an application environment setting which normally shows all errors fordevelopmentand suppresses error reporting fortestingandproduction. You should set this appropriately:If you actually want to capture these messages for a production environment you should update the
productionsettings in your index.php so that instead oferror_reporting(0)you have:offonFor example, in
index.phpyou could have:That way the messages/notices will still be saved to the
error_logif you want to review them, but they will not be shown to the end user.