Thinkphp is currently one of the most mainstream PHP lightweight frameworks. As a fully functional PHP framework, it has many built-in configurations. By modifying these systems The settings can easily modify some contents of thinkphp. This article summarizes some commonly used system settings for readers' reference.

# 'APP_DEBUG' => false, // Whether to enable debugging mode 'APP_DOMAIN_DEPLOY' => false, // Whether to use an independent domain name to deploy the project<br> 'APP_PLUGIN_ON' => false, // Whether to enable the plug-in mechanism<br> 'APP_FILE_CASE' => false, // Whether to check the case of the file Yes Valid on Windows platform<br> 'APP_GROUP_DEPR' => '.', // Separator between module groups<br> 'APP_GROUP_LIST' => '', // Project group setting, used between multiple groups Comma separated, for example, 'Home,Admin'<br> 'APP_AUTOLOAD_REG' => false, // Whether to enable SPL_AUTOLOAD_REGISTER<br> 'APP_AUTOLOAD_PATH' => 'Think.Util.', // __autoLoad Mechanism additional detection path settings , pay attention to the search order<br> 'APP_CONFIG_LIST' => array('taglibs','routes','tags','htmls','modules','actions'),//<br>Extra items The configuration list that needs to be loaded, the default includes: taglibs (tag library definition), routes (route definition), tags (tag definition), (htmls) static cache definition, modules (extension module), actions (extension operation) /* Cookie Settings */
'COOKIE_EXPIRE' => 3600, // Coodie validity period<br> 'COOKIE_DOMAIN' => '', // Cookie valid domain name<br> 'COOKIE_PATH' = > '/', // Cookie path<br> 'COOKIE_PREFIX' => '', // Cookie prefix to avoid conflicts /* Default settings */<br> 'DEFAULT_APP' => '@', //Default item Name, @ represents the current project<br> 'DEFAULT_GROUP' . 'index', //Default operation name<br> 'DEFAULT_CHARSET' => 'utf-8', //Default output encoding<br> 'DEFAULT_TIMEZONE' => 'PRC', //Default time zone<br> ' DEFAULT_AJAX_RETURN' => 'JSON', //Default AJAX data return format, optional JSON XML...<br> 'DEFAULT_THEME' => 'default', //Default template theme name<br> 'DEFAULT_LANG' = > 'zh-cn', //Default Language<br><br>/* Database Settings */ 'DB_TYPE' 'mysql ', 'mysql ' . 'localhost', // Server address 'DB_NAME' => '', 'DB_USER' // User name<br> 'DB_ PWD' => '', // password <br> 'db_port' = & gt; 3306, port <br> 'db_prefix' = & gt; 'think_', // database table prefix <br> 'db_suffix' = & gt; '', '', '', // Database table suffix<br> 'DB_FIELDTYPE_CHECK' => false, // Whether to perform field type checking<br> 'DB_FIELDS_CACHE' => true, // Enable field caching<br> 'DB_CHARSET' => 'utf8 ', //The database encoding defaults to utf8<br>'DB_DEPLOY_TYPE' => 0, // Database deployment mode: 0 centralized (single server), 1 distributed (master-slave server)<br> 'DB_RW_SEPARATE' => false, // Whether database reading and writing are separated master-slave The formula is valid <br> 'DATA_CACHE_TIME' => -1, // Data cache validity period<br> 'DATA_CACHE_COMPRESS' => false, // Whether the data cache is compressed or not <br> 'DATA_CACHE_CHECK' = > false, // Whether the data cache is verified to be cached<br> 'DATA_CACHE_TYPE' => 'File', // Data cache type
'DATA_CACHE_PATH' => TEMP_PATH, // Cache path setting (only valid for File mode caching) <br> 'DATA_CACHE_SUBDIR' => false, // Use subdirectory cache (automatically based on cache identification) Hash to create a subdirectory)<br> 'DATA_PATH_LEVEL' => 1, // Subdirectory cache level<br><br> /* Error settings */<br> 'ERROR_MESSAGE' => 'The page you are browsing is temporarily An error has occurred! Please try again later~', //Error display information, valid in non-debug mode<br> 'ERROR_PAGE' => '', // Error directed page<br><br> /* Static cache settings */<br> 'HTML_CACHE_ON' => false, // Turn off static cache by default <br> 'HTML_CACHE_TIME' => 60, // Static cache validity period <br> 'HTML_READ_TYPE' => 0, // Static cache reading method 0 readfile 1 redirect<br> 'HTML_FILE_SUFFIX' => '.shtml',//Default static file suffix<br><br> /* Language settings */<br> 'LANG_SWITCH_ON' => false, //Default closed Multi-language package function<br> 'LANG_AUTO_DETECT' => true, // Automatic detection of language is valid after turning on the multi-language function<br><br> /* Log settings */<br> 'LOG_RECORD' => false, // No logging by default <br> 'LOG_FILE_SIZE' => 2097152, // Log file size limit <br> 'LOG_RECORD_LEVEL' => array('EMERG','ALERT','CRIT','ERR') , // Allowed log level <br><br> /* Paging settings */<br> 'PAGE_ROLLPAGE' => 5, // Number of pages displayed in paging<br> 'PAGE_LISTROWS' => 20, // Paging displays the number of records per page<br><br> /* SESSION settings */<br> 'SESSION_AUTO_START' => true, // Whether to automatically open the Session<br> // Available parameters of the built-in SESSION class<br> // 'SESSION_NAME' => '', // Session name<br> //'SESSION_PATH' => '', // Session save path<br> //'SESSION_CALLBACK' => '', //Session object Callback function during deserialization<br><br> /* Run time setting */<br> 'SHOW_RUN_TIME' => false, // Run time display<br> 'SHOW_ADV_TIME' => false, // Display Detailed running time<br> 'SHOW_DB_TIMES' => false, // Display the number of database queries and writes<br> 'SHOW_CACHE_TIMES' => false, // Display the number of cache operations<br> 'SHOW_USE_MEM' => false, //Display memory overhead<br>'SHOW_PAGE_TRACE' => false, // Display page Trace information is defined by Trace file and assigned by Action operation<br> 'SHOW_ERROR_MSG' => true, // Display error message /* Template engine settings * /<br> 'TMPL_ENGINE_TYPE' => 'Think', // Default template engine The following settings are only valid for using the Think template engine<br> 'TMPL_DETECT_THEME' => false, // Automatically detect template themes<br> ' TMPL_TEMPLATE_SUFFIX' => '.html', // Default template file suffix<br> 'TMPL_CACHFILE_SUFFIX' => '.php', // Default template cache suffix<br> 'TMPL_DENY_FUNC_LIST' => 'echo,exit' , // Template engine disable function<br> 'TMPL_PARSE_STRING' => '', // The string that the template engine wants to automatically replace must be in the form of an array. <br> 'TMPL_L_DELIM' => '{', // Template engine ordinary tag start tag<br> 'TMPL_R_DELIM' => '}', // Template engine ordinary tag end tag<br> 'TMPL_VAR_IDENTIFY' =& gt ; 'array', // Template variable identification. Leave it blank to automatically judge. If the parameter is 'obj', it means the object<br> 'TMPL_STRIP_SPACE' => false, // Whether to remove html spaces and line breaks in the template file<br> 'TMPL_CACHE_ON' => true, // Whether Turn on the template compilation cache. If set to false, it will be recompiled every time. <br> 'TMPL_CACHE_TIME' => -1, ' TMPL_ACTION_ERROR' => 'Public:success', // The default error jumps to the corresponding template file<br> 'TMPL_ACTION_SUCCESS' => 'Public:success', // The default success jumps to the corresponding template file<br> ' TMPL_TRACE_FILE' => THINK_PATH.'/Tpl/PageTrace.tpl.php', // Page Trace template file<br> 'TMPL_EXCEPTION_FILE' => THINK_PATH.'/Tpl/ThinkException.tpl.php',// Exception The template file of the page<br> 'TMPL_FILE_DEPR'=>'/', //The separator between the template file MODULE_NAME and ACTION_NAME is only valid for project group deployment<br> //Think template engine tag library related settings<br> 'TAGLIB_BEGIN' => ' 'TAGLIB_END' => '>', // Tag library tag end tag<br> 'TAGLIB_LOAD' => ; true, // Whether to use other tag libraries other than the built-in tag library, automatically detected by default <br> 'TAGLIB_BUILD_IN' => 'cx', // The name of the built-in tag library (it is not necessary to specify the tag library name when using the tag), separated by a comma Separate <br> 'TAGLIB_PRE_LOAD' => '', // Tag libraries that need to be additionally loaded (the tag library name must be specified), multiple ones separated by commas<br> 'TAG_NESTED_LEVEL' => 3, // Tag nesting level<br>'TAG_EXTEND_PARSE' => '', // Specify the function name for extended definition and parsing of ordinary tags. <br><br>/*Form token verification*/<br> 'token_on' = & GT; True, // Open the token verification <br> 'token_name' = & gt; '__hash__', // token verification verification verification Form hidden field name<br> 'TOKEN_TYPE' => 'md5', // Token verification hash rules<br><br> /* URL settings */<br> 'URL_CASE_INSENSITIVE' => false, // Is the URL address case insensitive? , // URL access mode, optional parameters 0, 1, 2, 3, representing the following four modes: <br> // 0 (normal mode); 1 (PATHINFO mode); 2 (REWRITE mode); 3 (compatible Mode) Valid when URL_DISPATCH_ON is turned on; the default is PATHINFO mode, providing the best user experience and SEO support<br> 'URL_PATHINFO_MODEL' => 2, // PATHINFO mode, using the numbers 1, 2, and 3 to represent the following three modes :<br> // 1 Normal mode (parameters are not in order, such as /m/module/a/action/id/1);<br> // 2 Smart mode (the mode used by the system by default, which can automatically identify modules and operations )<br> // 3 Compatibility mode (pass PATHINFO to dispather through a GET variable, the default is s index.php?s=/module/action/id/1)<br> 'URL_PATHINFO_DEPR' => '/' , // In PATHINFO mode, the delimiter between each parameter<br> 'URL_HTML_SUFFIX' => '', // URL pseudo-static suffix setting<br><br> /* System variable name setting */<br> 'Var_group' = & gt; 'g', // The default group obtain variables <br> 'var_module' = & gt; // The default module obtain variables <br> 'var_action' = & gt; 'a', // The default operation obtain variable <br> 'var_router' = & gt; 'r', // default route to obtain variables <br> 'var_page' = & gt; 'p', // default paging jump transition volume <br> 'var_template' = > 't', //Default template switching variable<br> 'VAR_LANGUAGE' => 'l', //Default language switching variable<br> 'VAR_AJAX_SUBMIT' => 'ajax', //Default AJAX submission Variable<br> 'VAR_PATHINFO' => 's', // PATHINFO compatibility mode acquisition variable<br><br>
The above is the detailed content of Thinkphp common system configuration list. For more information, please follow other related articles on the PHP Chinese website!
How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AMPHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.
How does PHP handle object cloning (clone keyword) and the __clone magic method?Apr 17, 2025 am 12:24 AMIn PHP, use the clone keyword to create a copy of the object and customize the cloning behavior through the \_\_clone magic method. 1. Use the clone keyword to make a shallow copy, cloning the object's properties but not the object's properties. 2. The \_\_clone method can deeply copy nested objects to avoid shallow copying problems. 3. Pay attention to avoid circular references and performance problems in cloning, and optimize cloning operations to improve efficiency.
PHP vs. Python: Use Cases and ApplicationsApr 17, 2025 am 12:23 AMPHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.
Describe different HTTP caching headers (e.g., Cache-Control, ETag, Last-Modified).Apr 17, 2025 am 12:22 AMKey players in HTTP cache headers include Cache-Control, ETag, and Last-Modified. 1.Cache-Control is used to control caching policies. Example: Cache-Control:max-age=3600,public. 2. ETag verifies resource changes through unique identifiers, example: ETag: "686897696a7c876b7e". 3.Last-Modified indicates the resource's last modification time, example: Last-Modified:Wed,21Oct201507:28:00GMT.
Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1?Apr 17, 2025 am 12:06 AMIn PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.
PHP: An Introduction to the Server-Side Scripting LanguageApr 16, 2025 am 12:18 AMPHP is a server-side scripting language used for dynamic web development and server-side applications. 1.PHP is an interpreted language that does not require compilation and is suitable for rapid development. 2. PHP code is embedded in HTML, making it easy to develop web pages. 3. PHP processes server-side logic, generates HTML output, and supports user interaction and data processing. 4. PHP can interact with the database, process form submission, and execute server-side tasks.
PHP and the Web: Exploring its Long-Term ImpactApr 16, 2025 am 12:17 AMPHP has shaped the network over the past few decades and will continue to play an important role in web development. 1) PHP originated in 1994 and has become the first choice for developers due to its ease of use and seamless integration with MySQL. 2) Its core functions include generating dynamic content and integrating with the database, allowing the website to be updated in real time and displayed in personalized manner. 3) The wide application and ecosystem of PHP have driven its long-term impact, but it also faces version updates and security challenges. 4) Performance improvements in recent years, such as the release of PHP7, enable it to compete with modern languages. 5) In the future, PHP needs to deal with new challenges such as containerization and microservices, but its flexibility and active community make it adaptable.
Why Use PHP? Advantages and Benefits ExplainedApr 16, 2025 am 12:16 AMThe core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools






