CodeIgniter Configuration

This config.php file are located under application/config filder or your own custom configuration file. This class is initialized automatically by the system so there is no need to do it manually. To load custom config file, we have to use the following function within the controller.

$this->config->load('custom_config_file');

Where custom_config_file is the name of your config file, without the .php file extension. Default ‘config.php’ file contains the following configuration details. They are

Base Site URL

$config['base_url']='';

Index File

$config['index_page']='';

URI PROTOCOL

$config['uri_protocol']	= 'AUTO';//PATH_INFO, QUERY_STRING, REQUEST_URI, ORIG_PATH_INFO

URL suffix

$config['url_suffix']='';

Default Language

$config['language']='';

Default Character Set

$config['charset']='UTF-8';

Enable/Disable System Hooks

$config['enable_hooks']=FALSE;

Class Extension Prefix

$config['subclass_prefix'] = 'MY_';

Allowed URL Characters

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

Enable Query Strings


$config['allow_get_array']		= TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger']	= 'c';
$config['function_trigger']		= 'm';
$config['directory_trigger']	= 'd';

ERROR LOGGING Threshold


0 = Disables logging, Error logging TURNED OFF
1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages

$config['log_threshold'] = 0;
$config['log_path'] = '';
$config['log_date_format'] = 'Y-m-d H:i:s';
$config['cache_path'] = '';
$config['encryption_key'] = 'welcome';

SESSION


$config['sess_cookie_name']		= 'ci_session';
$config['sess_expiration']		= 7200;
$config['sess_expire_on_close']	= FALSE;
$config['sess_encrypt_cookie']	= FALSE;
$config['sess_use_database']	= FALSE;
$config['sess_table_name']		= 'ci_sessions';
$config['sess_match_ip']		= FALSE;
$config['sess_match_useragent']	= TRUE;
$config['sess_time_to_update']	= 300;

$config['cookie_prefix']	= "";
$config['cookie_domain']	= "";
$config['cookie_path']		= "/";
$config['cookie_secure']	= FALSE;

Global XSS Filtering

$config['global_xss_filtering'] = FALSE;

Cross Site Request Forgery


$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;

Output Compression

$config['compress_output'] = FALSE;

Master Time Reference

$config['time_reference'] = 'local';

Rewrite PHP Short Tags

$config['rewrite_short_tags'] = FALSE;

Reverse Proxy IPs

$config['proxy_ips'] = '';

 

Leave a Reply

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