codeigniter error reporting handling

Share on TwitterDigg This

1. Turn off PHP Errors with error_reporting(0)In the root directory of your CodeIgniter install, there is an index.php file. The first option in there is ‘PHP ERROR REPORTING LEVEL’.

 Set it to zero:error_reporting(0);CodeIgniter version 2.0.1 and above have an environment constant in the index.php file as well. Setting this to “production” will disable all PHP error output. Read more about this on the Codeigniter User Guide page on Security and on Handling Environments. 

2. Turn off Database Errors in Config
The PHP errors are off, but any MySQL errors are still going to show. Turn these off in the /config/database.php file. Set the db_debug option to false: 

$db['default']['db_debug'] = FALSE; 

3. Adjust Error Logging Threshold
The /config/config.php file has a log threshold option. It states “For a live site you’ll usually only enable Errors (1) to be logged otherwise your log files will fill up very fast.”

$config['log_threshold'] = 1;

4. Turn on all Errors in Config
In the root directory of your CodeIgniter install, there is an index.php file. The first option in there is ‘PHP ERROR REPORTING LEVEL’. Set it to :
error_reporting(E_ALL);

Random

About prabin t p

Connect with me on Google+
This entry was posted in codeigniter, php. Bookmark the permalink.

One Response to codeigniter error reporting handling

  1. Wonderful website. Plenty of helpful info here. I’m sending it to a few pals ans also sharing in delicious. And naturally, thanks on your effort!

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">