In-depth analysis of the php.ini configuration file, _PHP tutorial

WBOY
Release: 2016-07-12 08:57:35
Original
904 people have browsed it

In-depth analysis of the php.ini configuration file,

[PHP]
; PHP is still an evolving tool, and its functions are still growing Local deletion
; And the setting changes in php.ini can reflect considerable changes,
; Before using a new PHP version, it will be beneficial to study php.ini

;;;;;;;;;;;;;;;;;;;;
; About this file;
;;;;;;;;;;;;;;;;;; ;;

; This file controls many aspects of PHP. In order for PHP to read this file, it must be named
; 'php.ini'. PHP will search for the file in these places in sequence: the current working directory; the path specified by the environment variable PHPRC
;; the path specified during compilation.
; Under Windows, the path when compiling is the Windows installation directory.
; In command line mode, the search path of php.ini can be replaced with the -c parameter.

; The syntax of this file is very simple. Whitespace characters and lines starting with a semicolon ';' are simply ignored (as you might have guessed
;). Section titles (eg: [Foo]) are also simply ignored, even though they may
; have some meaning in the future.

; directives are specified using the following syntax:
; directive identifier = value
; directive = value
; directive identifier is *case-sensitive* - foo=bar is different from FOO = bar.

; The value can be a string, a number, a PHP constant (such as: E_ALL or M_PI), an INI constant
; a (On, Off, True, False, Yes, No and None), or an expression
; (e.g.: E_ALL & ~E_NOTICE), or a quoted string (" foo" ).

; Expressions in INI files are restricted Bitwise operators and parentheses.
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT

; Boolean flags can be set to 1, On, True or Yes. status.
; They can be set to off with the values ​​0, Off, False or No.

; An empty string can be represented by not writing anything after the equal sign, or using the None keyword:

; foo = ; Set foo to an empty string
; foo = none ; Set foo to the empty string
; foo = " none" ; Set foo to the string 'none'

; If you use constants in value settings, and these constants are dynamic Called into extension libraries (either PHP extensions, or Zend extensions), you can only use these constants *after* the lines that call in these extensions.

; All values ​​set in the php.ini-dist file are the same as the built-in defaults (that is, if php.ini
; is not used or you delete these lines , the default value is the same).


; Language options ;
;;;;;;;;;;;;;;;;;;;;;;;

engine = On

; Make the PHP scripting language engine available under Apache.
short_open_tag = On
; allows tags to be recognized.
asp_tags = Off
; Allow ASP-style tags
precision = 14
; The number of significant digits when displaying floating point type numbers

y2k_compliance = Off

; Whether to turn on Y2K compliance (may cause problems in non-Y2K compliant browsers)

output_buffering = Off

; Output buffering allows you to send header (including cookies) lines even after outputting the body content
; The cost is that the output layer slows down a little. You can use Output Cache to turn on output caching at runtime,
; or set the directive to On here to turn on output caching for all files.
output_handler = ; You can redirect all output of your script to a function,
; doing so may be useful for processing or logging it.
; For example, if you set this output_handler to "ob_gzhandler",
; the output will be transparently compressed for browsers that support gzip or deflate encoding.
; Set an output processor to automatically enable output buffering.

implicit_flush = Off

; Force flush to let PHP tell the output layer to automatically refresh its own data after each output block.
; This is equivalent to calling the flush() function after every print() or echo() call and after every HTML block.
; Turning on this setting will cause serious runtime conflicts. It is recommended to turn it on only during debugging.

allow_call_time_pass_reference = On

; Whether to force parameters to be passed by reference when calling the function. This method was protested
; and may no longer be supported in future versions of PHP/Zend.
; It is encouraged to specify which parameters are passed by reference in the function declaration.
; You are encouraged to try turning this option off and verify that your scripts still work, to ensure that they will still work
; in future versions of the language. (You will get a warning every time you use this feature, and arguments will be passed by value rather than by reference
;).

; Safe Mode Safe Mode
safe_mode = Off
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
; ? Setting certain environment variables
; ? may be a potential security breach.
; The directive contains a comma-separated list of prefixes. In safe mode, users can only replace
; with the values ​​of environment variables that begin with the prefixes listed here.
; By default, users will only be able to set environment variables starting with PHP_ (eg: PHP_FOO=BAR).
; NOTE: If this directive is empty, PHP will let the user change any environment variable!

safe_mode_protected_env_vars = LD_LIBRARY_PATH
; This directive contains a comma-separated list of environment variables that the end user will not be able to change using putenv ().
; These variables are protected even when safe_mode_allowed_env_vars is set to allowed.

disable_functions =
; This directive allows you to disable specific functions for security reasons.
; It accepts a comma separated list of function names.
; This instruction is *not* affected by whether safe mode is turned on or not.

; Color of syntax highlighting mode.
; As long as it is acceptable, it will work.

highlight.string = #DD0000
highlight.comment = #FF8000
highlight.keyword = #007700
highlight.bg = #FFFFFF
highlight.default = #0000BB
highlight. html = #000000

; Misc Misc
expose_php = Off
; Determines whether PHP should indicate the fact that it is installed on the server (for example: by adding it to the signal it — PHP — sends to the Web service
;).
; (My personal opinion is to turn this off when any power-by header appears.)
; It does not pose a security threat, but it makes it possible to check whether it is installed on your server. Made possible with PHP.



; Resource Limits ;
;;;;;;;;;;;;;;;;;;;;;

max_execution_time = 30 ; The maximum execution time of each script, in seconds
memory_limit = 8388608 ; The maximum total amount of memory that can be used by a script (here is 8MB)



; Error handling and logging;
; Error control and registration;

; Error reporting is bitwise. Or add up the numbers to get the desired error reporting level.
; E_ALL - all errors and warnings
; E_ERROR - fatal runtime errors
; E_WARNING - runtime warnings (non-fatal errors)
; E_PARSE - compile-time parsing errors
; E_NOTICE - runtime reminder (these are often caused by bugs in your code,
; may also be caused by intentional behavior. (eg: automatic initialization of an uninitialized variable to a
; null character based on String fact using an uninitialized variable)

; E_CORE_ERROR - Fatal error that occurs during the initialization process of PHP startup
; E_CORE_WARNING - Warning (non-fatal error) that occurs during the initialization process of PHP startup
; E_COMPILE_ERROR - Fatal error during compilation
; E_COMPILE_WARNING - compile-time warning (non-fatal error)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated reminder message
; Example:
; error_reporting = E_ALL & ~E_NOTICE ; Show all errors except reminders
; error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; Show only errors
error_reporting = E_ALL & ~E_NOTICE ; Show all Errors, in addition to reminders
display_errors = On ; display error messages (as part of the output)
; On the final published web site, it is strongly recommended that you turn off this feature and use
; error logs instead (see below).
; Continuing to enable display_errors on the final published web site may
; expose some security-related information, such as file paths on your web service,
; your database configuration, or other information.
display_startup_errors = Off ; Even when display_erroes is turned on, errors that occur during the PHP startup step
; will not be displayed.
; It is strongly recommended to keep display_startup_errors turned off,
; except during error correction.
log_errors = Off ; Record errors in a log file (server-specific log, stderr standard error output, or error_log (below))
; As stated above, it is strongly recommended that you log errors in the final published web site Log errors
; instead of direct error output.

track_errors = Off ; Save the latest error/warning message in the variable $php_errormsg (boolean)
;error_prepend_string = " " ; The string output before the error message
;error_append_string = " " ; The string output after
;error_log = filename; Record the error log in the specified file
;error_log = syslog; Record the error log in the system log syslog (event log under NT, invalid under Windows 95)
warn_plus_overloading = Off ; Warn when using ' ' with string



; Data Handling;

variables_order = "EGPCS"; This instruction describes the PHP record
; GET, POST, Cookie, Environment and Built-in of these variables order.
; (represented by G, P, C, E & S, usually referenced by EGPCS or GPC).
; Record from left to right, with new values ​​replacing old values.

register_globals = On ; Whether to register these EGPCS variables as global variables.
; You may want to turn this off if you don't want user data to be cluttered globally.
; This makes more sense in conjunction with track_vars — that way you can access all GPC variables via the
; $HTTP_*_VARS[] array.

register_argc_argv = On; This instruction tells PHP whether to declare argv and argc variables
; (Note: here argv is an array and argc is the number of variables)
; (which contains data passed by the GET method) .
; If you don't want to use these variables, you should turn them off to improve performance.

track_vars = On ; Make the $HTTP_*_VARS[] array valid, here* is replaced with
; ENV, POST, GET, COOKIE or SERVER when used.
post_max_size = 8M; PHP will accept the POST data Maximum size.


gpc_order = "GPC" ; This directive was objected to. Use variables_order instead.

; Magic quotes
magic_quotes_gpc = On ; Use magic quotes in the input GET/POST/Cookie data
; (The original text is like this, haha, the so-called magic quotes should refer to using escape characters to add quotes On the special control characters, such as '....)
magic_quotes_runtime= Off; Use magic quotes for data generated during runtime,
; For example: the data obtained by SQL query is obtained by using the exec() function Data, etc.
magic_quotes_sybase = Off ; Use Sybase-style magic quotes (use '' out ' instead of ')

; Automatically add files before and after PHP documents
auto_prepend_file =
auto_append_file =

; Like 4.04b4, PHP by default always outputs the encoding of a character in the "Content-type:" header.
; Disables the output character set, as long as it is set to empty.
; PHP's built-in default is text/html
default_mimetype = " text/html"
; default_charset = " iso-8859-1"

;;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;

include_path = ; include path settings, UNIX : " /path1:/path2" Windows: " path1;path2"
doc_root = ; The root path of the php page, only valid when it is not empty
user_dir = ; Tell php to open the script using /~username Which directory to search for, only valid when it is not empty
;upload_tmp_dir =; Temporary directory to store files uploaded using HTTP protocol (use the system default if not specified)
upload_max_filesize = 2097152; File upload is limited by default For 2 Meg
extension_dir = c:php; The directory where loadable extension libraries (modules) are stored
enable_dl = On; Whether to enable dl().
; The dl() function *doesn't* work well on multi-threaded servers,
; such as IIS or Zeus, and is disabled by default on them



; File Uploads ;

file_uploads = On ; Whether to allow HTTP file uploads
;upload_tmp_dir = ; Temporary directory for HTTP uploaded files (used if not specified) System default)
upload_max_filesize = 2M; Maximum allowed size of uploaded files

; Fopen wrappers ;

allow_url_fopen = On ; Whether to allow URLs to be treated as http:.. or files as ftp:...



; Dynamic Extensions;
; Dynamic Extensions;

; If you want an extension library to be loaded automatically, use the following syntax:
; extension=modulename.extension
; For example, on Windows,
; extension=msql.dll
; or on UNIX,
; extension=msql.so
; Note that this should only be the name of the module , no directory information is required to be placed in it.
; Use the extension_dir above to indicate the location of the specified extension library.


;Windows extension
;extension=php_nsmail.dll
extension=php_calendar.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
extension=php_gd .dll
;extension=php_dbm.dll
;extension=php_mssql.dll
;extension=php_zlib.dll
;extension=php_filepro.dll
;extension=php_imap4r2.dll
;extension=php_ldap.dll
;extension=php_crypt.dll
;extension=php_msql2.dll
;extension=php_odbc.dll
; Note that MySQL support is now built-in, therefore, No need to use its dll



; Module Settings ;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Syslog]
define_syslog_variables = Off ; Whether to define various system log variables
; Such as: $LOG_PID, $LOG_CRON, etc.
; Turning it off is a good idea to increase efficiency.
; At runtime, you can call the function define_syslog_variables() to define these variables


[mail function]
SMTP = localhost ; only for win32 systems
sendmail_from = me@localhost.com ; only for win32 systems
;sendmail_path = ;Only for unix, also supports parameters (default is 'sendmail -t -i')

[Debugger]
debugger.host = localhost
debugger.port = 7869
debugger.enabled = False

[Logging]
; These configurations indicate the logging mechanism used for the example.
; See examples/README.logging for more explanation
; logging.method = db
; logging.directory = /path/to/log/directory

[Java]
;java.class.path = .php_java.jar
;java.home = c:jdk
;java.library = c:jdkjrebinhotspotjvm.dll
;java.library.path = .

[SQL]
sql.safe_mode = Off

[ODBC]
;uodbc.default_db = Not yet implemented
;uodbc.default_user = Not yet implemented
;uodbc.default_pw = Not yet implemented
uodbc. allow_persistent = On ; Allow or disable persistent connections
uodbc.check_persistent = On ; Check whether the connection is still available before reusing it
uodbc.max_persistent = -1 ; The maximum number of persistent connections. -1 means unlimited
uodbc.max_links = -1 ; The maximum number of connections (persistent and non-persistent). -1 represents unlimited
uodbc.defaultlrl = 4096; Controls LONG type fields. Returns the number of bytes of the variable, 0 means passthru (?) 0 means passthru
uodbc.defaultbinmode = 1; Control binary data. 0 represents Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char
; See the documentation for odbc_binmode and odbc_longreadlen for explanations of uodbc.defaultlrl and uodbc.defaultbinmode.

[MySQL]
mysql.allow_persistent = On ; Allow or disable persistent connections
mysql.max_persistent = -1 ; The maximum number of persistent connections. -1 represents unlimited
mysql.max_links = -1 ; The maximum number of connections (persistent and non-persistent). -1 represents unlimited
mysql.default_port = ; The default port used by mysql_connect(). If not set, mysql_connect()
; will use the variable $MYSQL_TCP_PORT, or the mysql-tcp entry under /etc/services (unix),
; or MYSQL_PORT defined during compilation (in this order)
; Win32 environment will only check MYSQL_PORT.
mysql.default_socket = ; The default socket name used for local MySql connections. If empty, use MYSQL built-in value

mysql.default_host = ; The host used by mysql_connect() by default (invalid in safe mode)
mysql.default_user = ; The user name used by mysql_connect() by default (invalid in safe mode)
mysql.default_password = ; Password used by mysql_connect() by default (invalid in safe mode)
; Note that saving passwords under this file is generally a *bad* idea
; *Any* user with PHP access can run
; 'echo cfg_get_var(" mysql.default_password" )' to display that password!
; And of course, any user with permission to read the file can also see that password.

[mSQL]
msql.allow_persistent = On ; Allow or disable persistent connections
msql.max_persistent = -1 ; Maximum number of persistent connections. -1 represents unlimited
msql.max_links = -1 ; The maximum number of connections (persistent and non-persistent). -1 means unlimited

[PostgresSQL]
pgsql.allow_persistent = On ; Allow or disable persistent connections
pgsql.max_persistent = -1 ; The maximum number of persistent connections. -1 represents unlimited
pgsql.max_links = -1 ; The maximum number of connections (persistent and non-persistent). -1 means unlimited

[Sybase]
sybase.allow_persistent = On ; Allow or disable persistent connections
sybase.max_persistent = -1 ; Maximum number of persistent connections. -1 represents unlimited
sybase.max_links = -1; The maximum number of connections (persistent and non-persistent). -1 represents unlimited
;sybase.interface_file = "/usr/sybase/interfaces"
sybase.min_error_severity = 10; The minimum severity of the displayed error
sybase.min_message_severity = 10; The minimum severity of the displayed message Minimum importance
sybase.compatability_mode = Off ; Mode compatible with older versions of PHP 3.0. If turned on, this will cause PHP to automatically
; assign them the Sybase type based on the results,
; instead of treating them all as strings.
; This compatibility mode will not remain available forever,
; Therefore, make the necessary changes to your code,
; and turn it off.

[Sybase-CT]
sybct.allow_persistent = On ; Allow or disable persistent connections
sybct.max_persistent = -1 ; Maximum number of persistent connections. -1 means unlimited
sybct.max_links = -1 ; Maximum number of connections (persistent and non-persistent). -1 means unlimited
sybct.min_server_severity = 10 ; Minimum severity of errors displayed
sybct.min_client_severity = 10 ; Minimum severity of messages displayed

[bcmath]
bcmath.scale = 0 ; number of decimal digits for all bcmath functions

[browscap]
;browscap = extra/browscap.ini
browscap = C:WINSYSTEMinetsrvbrowscap.ini
[Informix]
ifx.default_host = ; ifx_connect() Host used by default (invalid in safe mode)
ifx.default_user = ; ifx_connect() Username used by default (invalid in safe mode)
ifx.default_password = ; ifx_connect() Password used by default (safe mode Invalid below)
ifx.allow_persistent = On; Allow or disable persistent connections
ifx.max_persistent = -1; The maximum number of persistent connections. -1 represents unlimited
ifx.max_links = -1 ; Maximum number of connections (persistent and non-persistent). -1 represents unlimited
ifx.textasvarchar = 0 ; If turned on, the select status code returns the content of a 'text blob' field instead of its id
ifx.byteasvarchar = 0 ; If turned on, the select status code returns Returns the contents of a 'byte blob' field rather than its id
ifx.charasvarchar = 0 ; Tracks whitespace stripped from a fixed-length character column.
; May work for Informix SE users.
ifx.blobinfile = 0 ; If turned on, the contents of text and byte blobs are exported to a file
; instead of being saved to memory.
ifx.nullformat = 0 ; NULL (empty) is returned as a null field, unless it is set to 1 here.
; In this case (1), NULL is returned as the string NULL.

[Session]
session.save_handler = files; Control method for saving/retrieving data
session.save_path = C:wintemp; Passed when save_handler is set to a file Parameters of the controller,
; This is the path where the data file will be saved.
session.use_cookies = 1; Whether to use cookies
session.name = PHPSESSID
; The name of the session used in cookies
session.auto_start = 0; Initialize the session when the request starts
session.cookie_lifetime = 0 ; It is the cookie storage time in seconds,
; or when it is 0, until the browser is restarted
session.cookie_path = / ; The effective path of the cookie
session.cookie_domain = ; Valid domain of cookie
session.serialize_handler = php ; Controller used to connect data
; php is the standard controller of PHP.
session.gc_probability = 1 ; Probability in percent that the 'garbage collection' process
; will start each time the session is initialized.
session.gc_maxlifetime = 1440 ; After the number of seconds indicated by the number here, the saved data will be considered
; 'garbage' and cleaned up by the gc process.
session.referer_check = ; Check HTTP referrers to invalidate additional ids included in URLs
session.entropy_length = 0 ; How many bytes to read from the file
session.entropy_file = ; Specify here to create a session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; Set to {nocache, private, public} to determine HTTP's
; cache Problem
session.cache_expire = 180; document expires after n minutes
session.use_trans_sid = 1; use transitional sid support, if enabled at compile time
; --enable-trans-sid
url_rewriter.tags = " a=href,area=href,frame=src,input=src,form=fakeentry"

[MSSQL]
;extension=php_mssql.dll
mssql.allow_persistent = On; Allow or disable persistent connections
mssql.max_persistent = -1; Maximum number of persistent connections . -1 represents unlimited
mssql.max_links = -1 ; The maximum number of connections (persistent and non-persistent). -1 means unlimited
mssql.min_error_severity = 10 ; Minimum severity of errors displayed
mssql.min_message_severity = 10 ; Minimum severity of messages displayed
mssql.compatability_mode = Off ; Same as older versions of PHP 3.0 compatible mode.

[Assertion]
; ? ? ? ? ?
;assert.active = On; ? assert(expr); active by default
;assert.warning = On ; issue a PHP warning for each failed assertion.
;assert.bail = Off ; don't bail out by default.
;assert .callback = 0 ; user-function to be called if an assertion fails.
;assert.quiet_eval = 0 ; eval the expression with current error_reporting(). set to true if you want error_reporting(0) around the eval() .

[Ingres II]
ii.allow_persistent = On ; Allow or disable persistent connections
ii.max_persistent = -1 ; Maximum number of persistent connections. -1 means unlimited
ii.max_links = -1 ; The maximum number of connections (persistent and non-persistent). -1 represents unlimited
ii.default_database = ; default database (format : [node_id::]dbname[/srv_class]
ii.default_user = ; default user
ii.default_password = ; default password

[Verisign Payflow Pro]
pfpro.defaulthost = " test.signio.com" ; Default Signio server
pfpro.defaultport = 443 ; Default port to connect to
pfpro .defaulttimeout = 30 ; Default timeout in seconds

; pfpro.proxyaddress = ; Default proxy IP address (if needed)
; pfpro.proxyport = ; Default proxy port
; pfpro.proxylogon = ; Default proxy login (logon user name)
; pfpro.proxypassword = ; Default proxy password

[Sockets]
sockets.use_system_read = On; Use the system's read() function instead of php_read() package
; Local Variables: (local variables)
; tab- width: 4
; End

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1108338.htmlTechArticleIn-depth analysis of the php.ini configuration file, [PHP]; PHP is still an evolving tool, and its functions are still It is constantly being deleted; and the setting changes of php.ini can reflect considerable changes; in...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!