General configuration in PHP.ini

Source: Internet
Author: User
This article is mainly to share with you php.ini in the common configuration of the detailed, mainly in the form of text and code and everyone to share, hope to help everyone.

Resource limits

Max_execution_time integer
    • This sets the maximum allowable execution time, in seconds, before the script is aborted by the parser. This helps prevent poorly written scripts from taking up server resources. The default setting is 30 . When you run PHP from the command line, the default setting is 0 .

    • max_execution_timeOnly affects the time that the script itself runs. Any other time spent outside the script, such as calls to the system using functions, system() sleep() Use of functions, database queries, file uploads, etc., is not included when calculating the maximum time the script runs.

    • The maximum execution time does not affect system calls, system operations, and so on. You cannot ini_set() modify this setting in Safe mode. The only workaround is to turn off safe mode or php.ini modify the time limit in.

Max_input_time integer

The 类似 POST 和 GET maximum allowable time, in seconds, for the script to parse the input data (). It is measured from receiving all the data to starting the execution script.

Memory_limit integer

Maximum amount of memory that the script may consume (default 128MB)

Data processing

Post_max_size Intager

The POST maximum byte length allowed for the data. This setting also affects file uploads. If POST the data exceeds the limit, then the $_POST and $_FILES will be empty. To upload a large file, the value must be greater than upload_max_filesize the value of the instruction. If memory throttling is enabled, the value should be less than memory_limit the value of the instruction.

Path settings

Include_path string

Specifies a set of directories to use for require(), include(), fopen_with_path() functions looking for files. The format is similar to the system's Path environment variable ( UNIX separated by colons, Windows separated by semicolons): UNIX: "/path1:/path2",Windows: "\path1;\path2" . Use '. ' In the Include path A relative path can be allowed, which represents the current directory.

Extension_dir string

The directory that holds the extension library (module), which is the directory that PHP uses to find the dynamic expansion module.

File Upload

File_uploads boolean or integer

Whether to allow HTTP file uploads. The default is to On allow HTTP file uploads, and this option cannot be set to OFF.

Upload_tmp_dir string

The temporary directory where files are stored when the file is uploaded (must be a user-writable directory of the PHP process). If not specified, PHP uses the system default temp directory.

Upload_max_filesize integer

Maximum size of files allowed to be uploaded.

Max_file_uploads integer

Maximum number of files allowed to be uploaded at the same time. Starting with PHP 5.3.4, the Upload field remains blank at the time of submission and does not count toward this limit.

Fopen Package

Allow_url_fopen Boolean

This option activates a URL 形式 fopen 封装协议 URL object such as a file that can be accessed. The default encapsulation protocol is provided ftp 和 http协议 to access remote files, and some extension libraries may, for example, zlib register more encapsulation protocols.

    • Note: For security reasons, this option can only be set in php.ini.

Allow_url_include Boolean

This option allows the following features to use URL-aware fopen encapsulation: included, include,include_once,require,require_once . This setting requires allow_url_fopen options to be 开启 .

Default_socket_timeout integer

socket 的流the default time-out (in seconds) based on.

Date

Date.timezone string

Define the default time zone used by the DATE function

Session

Session.use_strict_mode Boolean

session.use_strict_modeSpecifies whether the module will use a strict session ID pattern. If this mode is enabled, the module does not accept uninitialized session IDs. If an uninitialized session ID is sent from the browser, the new session ID is sent to the browser. The application is secured with a secure session through a strict mode session. The default is 0 (disabled).

Session.use_cookies Boolean

session.use_cookiesSpecifies whether the client is used cookie to store it 会话 ID . The default is 1 (enabled).

Session.cookie_secure Boolean

session.cookie_secureSpecifies whether to connect only through a secure connection 发送 cookie . The default is off .

Session.use_only_cookies Boolean

session.use_only_cookiesSpecifies whether the client is only used cookie to store it 会话 ID . Enabling this setting prevents attacks on passing a session ID through a URL. This setting is added by PHP 4.3.0. Starting with PHP 5.3.0, default value changed to 1 (enabled)

Session.name string

session.nameSpecifies the session name to use cookie 的名字 . Can only be made up of alphanumeric, by default PHPSESSID .

Session.auto_start Boolean

session.auto_startSpecifies whether the session module starts a session automatically when the request starts. The default is 0(不启动) .

Session.serialize_handler string

session.serialize_handlerDefines 序列化/解序列化 the processor name to use. PHP serialization Format (named Php_serialize), PHP PHP internal format (named PHP and Php_binary) and WDDX (named WDDX) are currently supported. If PHP is compiled with WDDX support, you can only use WDDX. Php_serialize can be used from PHP 5.5.4. php_serializefunctions are simply used internally serialize/unserialize , and there is no limit to PHP and php_binary. Using an older serialization processor causes neither can $_SESSION 的索引 数字 nor cannot be included 特殊字符(| and !) . Using php_serialize to avoid script exits, numeric and special character indexes cause an error. Used by default php .

Session.gc_probability integer

session.gc_probabilitysession.gc_pisorcombined with gc(garbag collection 垃圾回收) the probability to manage the start of a process. The default is 1 .

Session.gc_pisor integer

session.gc_pisorTogether, the session.gc_probability probability of starting a process at each session initialization is defined gc(garbage collection 垃圾回收) . This probability is gc_probability/gc_pisor calculated by calculation. For example, 1/100 means that there is a 1% probability of starting the GC process in each request. Increasing this value to 1000 will give you a 0.1% chance that the GC will run any given request. This is a more efficient method for mass-production servers.

Session.gc_maxlifetime integer

session.gc_maxlifetime integerSpecifies the number of seconds after which the data is considered "junk" and purged. Garbage collection may start at the start of the session (depending on the session.gc_probability and session.gc_pisor ).

    • Note: If different scripts have different session.gc_maxlifetime values but share the same place to store session data, the script with the smallest values cleans up the data. In this case, session.save_path use this directive with you.

For more information, please refer to: http://www.cnblogs.com/cuchadanfan/p/6163970.html

Resource limits

Max_execution_time integer
    • This sets the maximum allowable execution time, in seconds, before the script is aborted by the parser. This helps prevent poorly written scripts from taking up server resources. The default setting is 30 . When you run PHP from the command line, the default setting is 0 .

    • max_execution_timeOnly affects the time that the script itself runs. Any other time spent outside the script, such as calls to the system using functions, system() sleep() Use of functions, database queries, file uploads, etc., is not included when calculating the maximum time the script runs.

    • The maximum execution time does not affect system calls, system operations, and so on. You cannot ini_set() modify this setting in Safe mode. The only workaround is to turn off safe mode or php.ini modify the time limit in.

Max_input_time integer

The 类似 POST 和 GET maximum allowable time, in seconds, for the script to parse the input data (). It is measured from receiving all the data to starting the execution script.

Memory_limit integer

Maximum amount of memory that the script may consume (default 128MB)

Data processing

Post_max_size Intager

The POST maximum byte length allowed for the data. This setting also affects file uploads. If POST the data exceeds the limit, then the $_POST and $_FILES will be empty. To upload a large file, the value must be greater than upload_max_filesize the value of the instruction. If memory throttling is enabled, the value should be less than memory_limit the value of the instruction.

Path settings

Include_path string

Specifies a set of directories to use for require(), include(), fopen_with_path() functions looking for files. The format is similar to the system's Path environment variable ( UNIX separated by colons, Windows separated by semicolons): UNIX: "/path1:/path2",Windows: "\path1;\path2" . Use '. ' In the Include path A relative path can be allowed, which represents the current directory.

Extension_dir string

The directory that holds the extension library (module), which is the directory that PHP uses to find the dynamic expansion module.

File Upload

File_uploads boolean or integer

Whether to allow HTTP file uploads. The default is to On allow HTTP file uploads, and this option cannot be set to OFF.

Upload_tmp_dir string

The temporary directory where files are stored when the file is uploaded (must be a user-writable directory of the PHP process). If not specified, PHP uses the system default temp directory.

Upload_max_filesize integer

Maximum size of files allowed to be uploaded.

Max_file_uploads integer

Maximum number of files allowed to be uploaded at the same time. Starting with PHP 5.3.4, the Upload field remains blank at the time of submission and does not count toward this limit.

Fopen Package

Allow_url_fopen Boolean

This option activates a URL 形式 fopen 封装协议 URL object such as a file that can be accessed. The default encapsulation protocol is provided ftp 和 http协议 to access remote files, and some extension libraries may, for example, zlib register more encapsulation protocols.

    • Note: For security reasons, this option can only be set in php.ini.

Allow_url_include Boolean

This option allows the following features to use URL-aware fopen encapsulation: included, include,include_once,require,require_once . This setting requires allow_url_fopen options to be 开启 .

Default_socket_timeout integer

socket 的流the default time-out (in seconds) based on.

Date

Date.timezone string

Define the default time zone used by the DATE function

Session

Session.use_strict_mode Boolean

session.use_strict_modeSpecifies whether the module will use a strict session ID pattern. If this mode is enabled, the module does not accept uninitialized session IDs. If an uninitialized session ID is sent from the browser, the new session ID is sent to the browser. The application is secured with a secure session through a strict mode session. The default is 0 (disabled).

Session.use_cookies Boolean

session.use_cookiesSpecifies whether the client is used cookie to store it 会话 ID . The default is 1 (enabled).

Session.cookie_secure Boolean

session.cookie_secureSpecifies whether to connect only through a secure connection 发送 cookie . The default is off .

Session.use_only_cookies Boolean

session.use_only_cookiesSpecifies whether the client is only used cookie to store it 会话 ID . Enabling this setting prevents attacks on passing a session ID through a URL. This setting is added by PHP 4.3.0. Starting with PHP 5.3.0, default value changed to 1 (enabled)

Session.name string

session.nameSpecifies the session name to use cookie 的名字 . Can only be made up of alphanumeric, by default PHPSESSID .

Session.auto_start Boolean

session.auto_startSpecifies whether the session module starts a session automatically when the request starts. The default is 0(不启动) .

Session.serialize_handler string

session.serialize_handlerDefines 序列化/解序列化 the processor name to use. PHP serialization Format (named Php_serialize), PHP PHP internal format (named PHP and Php_binary) and WDDX (named WDDX) are currently supported. If PHP is compiled with WDDX support, you can only use WDDX. Php_serialize can be used from PHP 5.5.4. php_serializefunctions are simply used internally serialize/unserialize , and there is no limit to PHP and php_binary. Using an older serialization processor causes neither can $_SESSION 的索引 数字 nor cannot be included 特殊字符(| and !) . Using php_serialize to avoid script exits, numeric and special character indexes cause an error. Used by default php .

Session.gc_probability integer

session.gc_probabilitysession.gc_pisorcombined with gc(garbag collection 垃圾回收) the probability to manage the start of a process. The default is 1 .

Session.gc_pisor integer

session.gc_pisorTogether, the session.gc_probability probability of starting a process at each session initialization is defined gc(garbage collection 垃圾回收) . This probability is gc_probability/gc_pisor calculated by calculation. For example, 1/100 means that there is a 1% probability of starting the GC process in each request. Increasing this value to 1000 will give you a 0.1% chance that the GC will run any given request. This is a more efficient method for mass-production servers.

Session.gc_maxlifetime integer

session.gc_maxlifetime integerSpecifies the number of seconds after which the data is considered "junk" and purged. Garbage collection may start at the start of the session (depending on the session.gc_probability and session.gc_pisor ).

    • Note: If different scripts have different session.gc_maxlifetime values but share the same place to store session data, the script with the smallest values cleans up the data. In this case, session.save_path use this directive with you.

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.