Error reporting and debugging in codeigniter

To Turn off Debugging

Set the db_debug value(in the application/config/database.php config file) to false

To Turn off Error reporting

Set the Envirement value(in the top of the main index.php) to production or testing

Replace define(‘ENVIRONMENT’, ‘development’); to define(‘ENVIRONMENT’, ‘production’);

One another way to make all of this easy has been for me to set the db_debug value (in the application/config/database.php config file) to a constant I declare MP_DB_DEBUG. And add the following code to the top of the main index.php to replace the error_reporting() declaration when the site is live (will disable all errors):

ini_set('display_errors', 'Off');
define('MP_DB_DEBUG', false); 
But when in production or testing phase I’d suggest:
ini_set('display_errors', 'On');
define('MP_DB_DEBUG', true);

Bansal Sumit

To seek challenging roles and to achieve excellence in the field of Open Source Web Technology with a profound spirit of commitment and dedication.

Leave a Reply

Your email address will not be published. Required fields are marked *