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);
No comments:
Post a Comment