Common php. ini configurations

Source: Internet
Author: User
For common php. ini configurations, see legolas. blog.51cto. com2631685493917. the file must be named php. ini and placed in the directory specified by the PHPIniDir command in httpd. conf. You can view the latest version of php. ini in the following two locations: cvs. php. netviewvc. cgiphp-src php. ini common configuration
Refer: http://legolas.blog.51cto.com/2682485/493917 This file must be named ''php. ini ''and placed in the directory specified by the PHPIniDir command in httpd. conf. The latest php. ini version can be viewed in the following two locations: http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?view=cohttp://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?view=co Syntax the syntax of this file is very simple. Blank characters and rows starting with semicolons are ignored. Chapter titles (for example, [php]) are also ignored, even if they may make some sense in the future. Set the command format as follows: directive = value command name (directive) is case sensitive! Therefore, "foo = bar" is different from "FOO = bar ". The value can be: 1. string defined by quotation marks (for example, "foo") 2. A number (integer or floating point number, such as: 0, 1, 34,-1, 33.55) 3. a php constant (for example, E_ALL, M_PI) 4. an INI constant (On, Off, none) 5. an expression (for example, E_ALL &~ E_NOTICE) the expression in the INI file only uses: bit operator, non-logical, parentheses: | bit or & bit and ~ Non! The non-Boolean logical flag is enabled with On and Off. An empty string can be used to represent nothing after the equal sign, or use the none keyword: foo =; to set foo as an empty string foo = none; set foo to an empty string foo = "none"; set foo to the string ''non'' if you use dynamic extension (PHP extension or Zend extension) in the command value) so you can only use these constants after loading these dynamically scalable command lines. Httpd. conf; can also be found in httpd. overwrite php. ini value for more flexible configuration: php_value name value; set a non-bool type command, set the value to none, then clear the previously set php_flag name on | off; PHP constants (such as E_ALL) can only be set in php. used in ini, in httpd. the corresponding mask value must be used in the conf file. Commands with the "SYS" flag can only be found in httpd. the global configuration section in conf is used. commands with the "ini" flag cannot be in httpd. conf. they can only be used in php. ini. ================================ Configuration instructions ============================ =================================== common PHP. INI configuration item. 1 -- set the size of the uploaded file file_uploads = onupload_max_filesize = 8Mpost_max_size = 8Mps -- the value of post must be greater than or equal to upload; otherwise, upload does not work. 2 -- set the maximum memory memory_limit = 128M3 used by a script -- enable the global variable register_gloables = onps -- some programs such as OSC need to enable global variables. 4 -- set the default encoding default_charset = 'ISO -- 8859-1 'ps -- this generally does not need to be set because most pages are encoded. 5 -- whether to allow opening the remote file allow_url_fopen = on6 -- whether to allow including remote files (include/require) allow_url_include = false7 -- time zone date. timezone = UTCps -- php uses the time zone in the configuration item by default. if the project involves the time zone, use date_default_timezone_get ()/date_default_timezone_set (utc) to set the time zone you want. 8 -- disable classes/methods disable_classes = disable_functions = ps -- many methods have been disabled in my php. ini, which affects the use of some functions, such as remote links. An email should be sent in response. 9 -- set the error report level error_reporting = ps -- the log level is a constant and is written in php. ini. we recommend using E_ALL | E_STRICT, that is, all levels. 10 -- output error message display_error = offps -- whether to use the error message as a part of the output. after the site is published, disable this function to avoid information exposure. 11 -- define the system log variable define_syslog_variables = offps -- we recommend that you disable it to improve performance. 12 -- error log error_log = ps -- location of the error log, which must be writable to web users. if not defined, the error log is written to the web server by default. log_errors = onps -- as mentioned above, we recommend that you output the error log to a file instead of the front-end. Log_errors_max_length = 1024 ps -- maximum length of error log Association Information. if it is set to 0, it indicates an infinite length. 13 -- default socket duration default_socket_timeout = 6014 -- Maximum execution duration of the script max_execution_time = 30 ps -- sets the maximum execution duration of each script to prevent unauthorized use of server resources; 0 indicates no limit. 15 -- maximum input time of the script max_input_time = 60 ps -- maximum input time of a single script 16 -- temporary directory of file Upload upload_tmp_dir = ps -- writable directory for php process users. If this parameter is not set, the system temporary directory is used. (Tmp) 17 -- automatically refresh data after output implicit_flush = offps -- whether to refresh data after echo (); printf (); and other output data blocks; serious impact on performance, we recommend that you enable this function only in the debugging status.


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.