Introduction to the basic configuration file config. php of CodeIgniter framework

Source: Internet
Author: User
Tags php server

The basic configuration information of CodeIgniter is in the application/config. php file. This article describes each basic configuration option in detail to quickly master CodeIgniter for development.

$ Config ['base _ url'] = "http://www.bkjia.com /". The URL of your website. CodeIgniter generates links and form addresses based on the URL.

$ Config ['index _ page'] = "index. php": name of the index. php file under the CodeIgniter root directory. CodeIgniter uses this file to generate a link address. If you use the URL to hide index. php, set it to an empty string: $ config ['index _ page'] = "".

$ Config ['uri _ Protocol'] = "AUTO" CodeIgniter: format used to generate the URL. set it to "AUTO" for automatic detection. If the link does not work properly, try the following values: PATH_INFO, QUERY_STRING, REQUEST_URI, and ORIG_PATH_INFO.

$ Config ['url _ suffix '] = "". The URL suffix used by CodeIgniter to generate a link. To implement pseudo-static state, you can set $ config ['url _ suffix '] = ". html ".

$ Config ['language'] = "english ". Default CodeIgniter Language

$ Config ['charset'] = "UTF-8 ". Default character set used by the CodeIgniter Program

$ Config ['Enable _ hooks'] = FALSE. Whether to enable the hook function. The hook function allows you to change or add the core running function of the system without modifying the core file of the system.

$ Config ['subclass _ prefix'] = 'my _'. Set the class name prefix used to extend the CodeIgniter class library

$ Config ['permitted _ uri_chars'] = 'a-z 0-9 ~ % .:_\-'. Set the characters allowed in the CodeIgniter URL. This is a regular expression. When a visitor attempts to access a CodeIgniter URL that contains other characters, a warning is given. We recommend that you restrict the characters used by CodeIgniter URLs to improve security and effectively filter injection attacks. If it is set to null, all characters are allowed. We strongly recommend that you do not do this.

$ Config ['Enable _ query_strings '] = FALSE. CodeIgniter URLs use segmented URLs by default. This option also allows CodeIgniter to enable string-based URL query. You can use query strings to pass the controllers and functions to be accessed. For example, index. php? C = controller & m = method. CodeIgniter uses segmented URLs by default. Many features of string URL query 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 logs and set the types of errors to be recorded.

  • 0 = Disable Error Logging
  • 1 = record error information
  • 2 = record debugging information
  • 3 = record Notification Information
  • 4 = record all information

$ Config ['Log _ path'] = "". If you do not want to use the default error log directory configuration (system/logs/), you can set the complete Server Directory.

$ Config ['Log _ date_format'] = 'Y-m-d H: I: s '. CodeIgniter error log time format

$ Config ['cache _ path'] = "". If you do not want to use the default cache directory (system/cache/) to store the cache, you can set the complete Server Directory

$ Config ['encryption _ key'] = "". Key used by CodeIgniter

$ Config ['Global _ xss_filtering '] = FALSE. Whether to automatically filter cross-script attacks against input data (GET and POST)

$ Config ['compress _ output'] = FALSE. Enable Gzip compression to achieve the fastest page loading speed

$ Config ['time _ reference '] = 'local '. Set the time format: "local", "GMT"

$ Config ['rewrite _ short_tags'] = FALSE. If you want to use the short tag, but not supported by the PHP server, CodeIgniter can rewrite the short tag to support this function.

$ Config ['proxy _ ip'] = "". If a visitor accesses your website through a proxy server, you must set a proxy server IP list to identify the visitor's real IP address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.