Codeigniter application configuration details

Source: Internet
Author: User
Tags blank page codeigniter

Bytes ----------------------------------------------------------------------------------------------------------

Application configuration file application/config. php
[Email protected] Black Eye poet <www. chenwei. ws> ----------------------------------
1. Root URL [domain name/path] (required)

2. index file (optional, default index)

3. Uri protocol (optional, auto by default)

4. url suffix (optional, empty by default)

5. default language (optional, default English)

6. character set (optional, default: UTF-8)

7. Whether the system 'hook 'is supported (optional, default: false)

8. extension class suffix (optional, default: My _)

9. characters allowed in the URL (optional, default a-Z 0-9 ~ % .:_\-)

10. Whether query strings are supported (optional)
$ Config ['Allow _ get_array '] = true; // default value, indicating that strings can be received in the form of $ _ Get
$ Config ['Enable _ query_strings '] = false; // by default, URL-based query strings are not used, for example, example.com? WHO = Me & what = something & where = here
$ Config ['controller _ trigger'] = 'C'; // controller trigger
$ Config ['function _ trigger'] = 'M'; // method trigger
$ Config ['Directory _ trigger'] = 'D'; // if the Controller is in a subdirectory, this parameter must be included in the URL to specify the subdirectory name of the controller.

Note: If the URL-based query string is enabled, the Controller and method can be called using the keyword. However, if you use the query string, you must use your own URL, in addition, you cannot use URL helper functions (or other helper functions that generate URLs, such as form helper functions), because Ci is designed based on Segmented URLs.

11. Error Log threshold (optional, default: 0)
0-Disable logs. Disable Error logs.
1-error messages (including PHP errors)
2-Debug messages
3-information message
4-all messages
Note: For existing websites, you can only enable 1; otherwise, log files will be quickly filled up.

12. error log directory path (optional, empty by default)
Note: It can be the application/logs/directory name, using the complete server path containing the slash

13. Log date format (optional, Y-m-d h: I: s by default)

14. cache directory path (optional, empty by default)
Note: It can be the system/Cache/directory name, using the complete server path containing the slash

15. encryption key (required, empty by default)
Note: If you use an Encryption Class or session class, you must set an encryption key.

16. Session variables (optional, the default value is as follows)
$ Config ['sess _ cookie_name '] = 'Ci _ Session'; // The cookie name you want
$ Config ['sess _ expiration '] = 7200; // session validity period. If the value is 0, no restriction is imposed.
$ Config ['sess _ expire_on_close '] = false; // disable the browser window to check whether the session expires.
$ Config ['sess _ encrypt_cookie '] = false; // whether to encrypt the cookie
$ Config ['sess _ use_database '] = false; // whether to save session data to the database
$ Config ['sess _ table_name '] = 'Ci _ session'; // session data table name
$ Config ['sess _ match_ip '] = false; // whether to match the user's IP address when reading session data
$ Config ['sess _ match_useragent '] = true; // whether to match the user agent when reading session data
$ Config ['sess _ time_to_update '] = 300; // how many seconds to refresh session information

17. Cookie-related variables (optional, the default value is as follows)
$ Config ['cookie _ prefix'] = ""; // you can set the cookie prefix to avoid collision.
$ Config ['cookie _ Domain '] = ""; // set the domain name, such as .example.com, to the cookie within the scope of the website.
$ Config ['cookie _ path'] = "/"; // The Cookie Path is usually a forward slash.
$ Config ['cookie _ Secure '] = false; // If a secure HTTPS connection exists, the secure cookie is set and disabled by default.

18. Global XSS filtering (optional, default: false)
Determines whether the XSS filter takes effect. When get, post, or cookie data is encountered.

19. Cross-Site Request Forgery (recommended, default: false)
$ Config ['csrf _ protection '] = false; // whether to enable csrf cookie token
$ Config ['csrf _ token_name '] = 'csrf _ test_name'; // token name
$ Config ['csrf _ cookie_name '] = 'csrf _ cookie_name'; // cookie name
$ Config ['csrf _ expire '] = 7200; // token expiration time
NOTE: If it is enabled, the token will be checked when the form is submitted. If you are allowed to receive data submitted by users, it is strongly recommended to enable csrf protection.

20. Output compression (optional, default: false)
When output compression is enabled, the output class checks whether your server supports gzip. Even if it supports gzip, not all browsers support compression, so you can only enable it when you are quite sure that your visitor can perform the operation.
Important: When Gzip is enabled, if you get a blank page, it means that you prematurely output something to the browser, and it may even be a space in the last line of the script. In order to compress and work properly, you cannot send anything before using the output class output buffer. When Gzip is enabled, do not 'echo 'to output any value.

21. Time Reference (optional, default local)
Tell the system whether to use the local time of your server for reference to the master, or convert it to GMT. For more information, see 'date helper 'in the user manual'

22. Rewrite PHP short labels (optional, default: false)
If the PHP you install does not support short tags, CI can re-write tags during information transmission so that you can use the short tag syntax in the View File.

23. Reverse Proxy (optional, empty by default)
If your server is a reverse proxy, in order to correctly identify the visitor's IP address, you must specify the proxy IP addresses in the http_x_forwarded_for header that the CI should trust to the White List, separated by commas (,), for example: 10.0.1.200, 10.0.1.201

Bytes --------------------------------------------------------------------------------------------------------

Codeigniter application configuration details

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.