Home >Backend Development >PHP Tutorial >Detailed introduction to the basic configuration of CodeIgniter_PHP tutorial
$config['base_url'] = "http://www.jb51.net/". The URL of your website. CodeIgniter will generate links, form addresses, etc. based on this URL.
$config['index_page'] = "index.php" The index.php file name in the CodeIgniter root directory. CodeIgniter will use it to generate the link address. If using a URL that hides index.php, set it to the empty string: $config['index_page'] = "".
$config['uri_protocol'] = "AUTO" The format used by CodeIgniter to generate URLs, set to "AUTO" automatic detection. If the link is not working properly, you can try the following values: PATH_INFO, QUERY_STRING, REQUEST_URI, ORIG_PATH_INFO.
$config['url_suffix'] = "" . The URL suffix used by CodeIgniter when generating links. If you want to achieve pseudo-static, you can set $config['url_suffix'] = ".html".
$config['language'] = "english" . The default language used by the CodeIgniter program is
$config['charset'] = "UTF-8". The default character set used by the CodeIgniter program
$config['enable_hooks'] = FALSE. Whether to enable hooks, the hook function allows you to change or increase the core running functions of the system without modifying the core system files.
$config['subclass_prefix'] = 'MY_' . Set the class name prefix used when extending the CodeIgniter class library
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-' . Sets the characters allowed in CodeIgniter URLs, which is a regular expression. Visitors will get a warning when they try to access a CodeIgniter URL that contains other characters. You should try to limit the characters used in CodeIgniter URLs to improve security and effectively filter injection attacks. If set to empty, all characters are allowed, which is strongly discouraged.
$config['enable_query_strings'] = FALSE . CodeIgniter URLs use segmented URLs by default, this option also allows CodeIgniter to enable query string form URLs. You can use query strings to pass the controllers and functions you want to access. For example: index.php?c=controller&m=method. CodeIgniter uses segmented URLs by default, and many features of query string URLs are not supported.
$config['controller_trigger'] = 'c' . CodeIgniter treats the value corresponding to this option in the query string as the name of the CodeIgniter controller.
$config['function_trigger'] = 'm' . CodeIgniter treats the value corresponding to this option in the query string as the name of the CodeIgniter controller method
$config['log_threshold'] = 0 . Enable error logging and set what types of errors are logged.
0 = Turn off error logging
1 = Log error information
2 = Log debugging information
3 = Log notification information
4 = Log all information
$config['log_path' ] = "". If you do not want to use the default error logging directory configuration (system/logs/), you can set up the complete server directory.
$config['log_date_format'] = 'Y-m-d H:i:s' . CodeIgniter error log time format
$config['cache_path'] = "". If you don't want to use the default cache directory (system/cache/) to store cache, you can set the full server directory
$config['encryption_key'] = "" . Key used by CodeIgniter
$config['global_xss_filtering'] = FALSE. Whether to automatically filter cross-script attacks on input data (GET, POST)
$config['compress_output'] = FALSE. Enable Gzip compression for fastest page loading speeds
$config['time_reference'] = 'local'. Set time format: "local", "GMT"
$config['rewrite_short_tags'] = FALSE. If you want to use short tags but the PHP server doesn't support it, CodeIgniter can support this functionality by overriding the short tags.
$config['proxy_ips'] = "". If visitors access your website through a proxy server, you must set up a proxy server IP list to identify the visitor's real IP.