PHP configuration file in a detailed

Source: Internet
Author: User
Tags bitwise bitwise operators control characters informix mssql sybase syslog payflow pro
PHP is a simple and easy to learn, powerful language, especially in the web development, the development of high efficiency, convenient and fast. It's a good idea to study php.ini about PHP-related configurations and get a better understanding of PHP.

[PHP]

;;;;;;;;;;;;;;;;;;;

; About this document;

;;;;;;;;;;;;;;;;;;;

This file controls many aspects of PHP's view. In order for PHP to read this file, it must be named

;' PHP.ini '. PHP will look for the file in these places: current working directory; environment variable PHPRC

; The specified path; the path that you specify at compile time.

Under Windows, the compile-time path is the Windows installation directory.

In command-line mode, the php.ini lookup path can be substituted with the-c parameter.

The syntax of the file is very simple. Blank characters and semicolons '; ' The starting line is simply ignored (as you might

, guessed the same). Chapter headings (For example: [Foo]) are also simply ignored, even though they may in the future

There is a sense of some kind.

;

The instruction is specified using the following syntax:

; indicates identifier = value

;d Irective=value

Indicates that the identifier is case-sensitive *-foo=bar differs from Foo=bar.

;

The value can be a string, a number, a PHP constant (such as: E_allor M_PI), the INI constant in the

; one (On,off,true,false,yes,no and None), or an expression

;(such as: E_all&~e_notice), or a string enclosed in quotation marks ("foo").

;

The. INI file expression is limited to bitwise operators and parentheses.

; |bitwise OR

; &bitwise and

; ~ Bitwise NOT

;! Boolean not

;

The Boolean flag can be used 1,on,trueor Yes to leave the values in the open state.

; they can be 0,off,falseor No These values are placed off the state.

;

An empty string can be used after an equal sign to not write anything, or with the None keyword:

;

; foo=; set Foo to an empty string

; foo=none; set Foo to an empty string

; foo= "None"; put Foo As String ' None '

;

If you use constants in your value settings, and those constants belong to an extension library that is dynamically tuned in (not an extension of PHP, or an extension of Zend), you can only use these constants after you have called the extended rows *.

;

All the values set in the Php.ini-dist file are the same as the built-in default values (this means that if php.ini is not used or you delete the rows, the default value is the same).

;;;;;;;;;;;;;;;;;;;;

; Language Options;

;;;;;;;;;;;;;;;;;;;;

Engine=on

; Make PHP scripting language engine (PHP scripting language Engine) valid under Apache.

Short_open_tag=on

Allow tags to be recognized.

Asp_tags=off

; Allow Asp-style tags

Precision=14

; The number of significant digits when floating-point type is displayed

Y2k_compliance=off

; Whether to open 2000 adaptation (may cause problems in non-Y2K adapted browsers)

Output_buffering=off

The output cache allows you to send headers (headers, including cookies) even after the output of the body content.

The cost is that the output layer slows down a little bit. You can use output caching to open the output cache at run time.

, or set the instructions here to on so that the output cache for all files is opened.

output_handler=; You can redirect all the output of your script to a function,

That might be useful for processing or logging it.

For example, if you set this output_handler to "Ob_gzhandler",

, the output is transparently compressed for the browser that supports gzip or deflate encoding.

; Set an output processor to automatically turn on the output buffer.

Implicit_flush=off

Forcing flush (refresh) allows PHP to tell the output layer to automatically refresh its data after each output block.

This is equivalent to calling the flush () function after each print () or echo () call and each HTML block.

Opening this setting can cause serious runtime conflicts and is recommended to be opened only during the debug process.

Allow_call_time_pass_reference=on

; Whether to let arguments be passed by reference when forcing a function call. This approach has been protested,

, and may no longer be supported in future versions of Php/zend.

To be encouraged to specify which parameters are passed by reference in the function declaration.

; you are encouraged to try to close this option and confirm that your script still works to ensure that in future versions of the language

; they can still work. (You'll get a warning every time you use this feature, and the argument will be by value instead of by reference

; transfer).

; Safe Mode

Safe_mode=off

Safe_mode_exec_dir=

Safe_mode_allowed_env_vars=php_

The indicator contains a comma-delimited list of prefixes. In Safe mode, users can only replace

; The value of the environment variable that begins with the prefix listed here.

By default, users will only be able to set environment variables that start with PHP_ (for example, Php_foo=bar).

Note: If this instruction is empty, PHP will let the user change any environment variable!

Safe_mode_protected_env_vars=ld_library_path

This directive contains a comma-delimited list of environment variables that end users will not be able to change with putenv ().

These variables are protected even when the Safe_mode_allowed_env_vars is set to allow.

disable_functions=

This instruction allows you to invalidate a particular function for security reasons.

; it accepts a comma-delimited list of function names.

This instruction * is not affected by the open security mode.

; The color of the syntax highlighting mode.

, as long as the acceptable things can work.

highlight.string= #DD0000

Highlight.comment= #FF8000

highlight.keyword= #007700

highlight.bg= #FFFFFF

highlight.default= #0000BB

Highlight.html= #000000

; Misc Miscellaneous

Expose_php=off

and decide if PHP will indicate the fact that it's loaded on the server (for example: add it?). Php? To Web Services

On the signal sent).

(My personal opinion, in the presence of what power-by header, turn this off.) )

It will not be a security threat, but it makes it possible to check if PHP is installed on your server.

;;;;;;;;;;;;;;;;;;;

; Resource Limits;

;;;;;;;;;;;;;;;;;;;

max_execution_time=30; Maximum execution time per script, per second

memory_limit=8388608; The maximum amount of memory a script can use (this is 8MB)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Error handling and logging;

; error control and registration;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

The error report is bitwise. Or add up the numbers to get the error report level you want.

; e_all-all errors and warnings

; e_error-Fatal Run-time error

; e_warning-Runtime Warning (non-fatal error)

; e_parse-compile-time parsing errors

; e_notice-Runtime Reminders (These are often caused by bugs in your code,

, or it may be intentional behavior. (for example, an uninitialized variable is automatically initialized to a

The fact of an empty string uses an uninitialized variable)

; e_core_error-fatal error during initialization of PHP startup

; E_core_warning-is a warning (non-fatal error) that occurs during initialization of PHP startup

; e_compile_error-compile-time fatal error

; e_compile_warning-Compile-time warning (non-fatal error)

; e_user_error-user-generated error messages

; e_user_warning-user-generated warning messages

; e_user_notice-user-generated reminder messages

Example

;error_reporting=e_all&~e_notice; shows all errors except reminders

; error_reporting=e_compile_error| e_error| E_core_error; show only errors

error_reporting=e_all&~e_notice; shows all errors except reminders

Display_errors=on; Displays an error message (as part of the output)

On the final published Web site, it is strongly recommended that you turn off this feature and use the

Error log instead (see below).

In the final release of the Web site continue to make display_errors effective possible

, exposing some information about security, such as the file path on your Web service,

, your database planning or other information.

Display_startup_errors=off; even when Display_erroes is open, it happens in PHP's start-up steps

, and the error will not be displayed.

; It is strongly recommended to keep the display_startup_errors closed,

Except in the process of making mistakes.

Log_errors=off: Error logged in log file (server-specified 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

; Replace the direct error output.

Track_errors=off; Save most recent error/warning message to Variable $php_errormsg (Boolean)

Error_prepend_string= ""; the string to be output before the error message

; error_append_string= ""; string to output after error message

; error_log=filename; logs the error log to the specified file

; error_log=syslog; Log error logs in System log syslog (event log under NT, Windows95 Invalid)

Warn_plus_overloading=off: Warning when ' + ' is used for strings

;;;;;;;;;;;;;;;;;

;D ATA handling;

;;;;;;;;;;;;;;;;;

Variables_order= "Egpcs"; this instruction describes the PHP record

; Get,post,cookie,environment and built-in The order of these variables.

; (represented by g,p,c,e&s, usually referred to as egpcs or GPC).

; The new value replaces the old value by a left-to-right record.

Register_globals=on; whether to register these egpcs variables as global variables.

If you don't want the user data to be out of the global scope, you might want to close it.

Is it more meaningful to connect with Track_vars? So that you can pass

; $HTTP _*_vars[] array accesses all the GPC variables.

Register_argc_argv=on This instruction tells PHP whether to declare argv and ARGC variables

; (Note: Here argv is an array, ARGC is the number of variables)

; (which contains data from the Get method).

If you don't want to use these variables, you should turn it off to improve performance.

Track_vars=on; make the $http_*_vars[] array valid, here * in use

; Env,post,get,cookie or server replacement

post_max_size=8m; The maximum size of post data that PHP will accept.

Gpc_order= "GPC"; this instruction was objected to. Replace with Variables_order.

; Magic Quotes

Magic_quotes_gpc=on, using the Magic reference in the input Get/post/cookie data

(In this way, hehe, the so-called magic quotes should be used to escape multibyte in the quoted control characters, such as ' .... )

Magic_quotes_runtime= Off; Use a magic reference to the data generated at run time,

; For example: data obtained with SQL queries, data obtained with the EXEC () function, etc.

Magic_quotes_sybase = OFF; Use Sybase as a magic reference ("Out of the way" instead of ')

; Automatically add files before and after a PHP document

Auto_prepend_file =

Auto_append_file =

; Like 4.04B4, PHP defaults to the "Content-type:" header to output a character encoding.

; Invalidates the output character set as long as it is set to null.

; The built-in default value for PHP is text/html

Default_mimetype = "Text/html"

;d efault_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, valid only when not empty

User_dir =; Tell PHP which directory to search for when opening a script with/~username, only valid when not empty

; upload_tmp_dir =; Temporary directory for files uploaded with HTTP protocol (use system default if not specified)

Upload_max_filesize = 2097152; File upload is limited to 2 Meg by default

Extension_dir = c:\php\; A directory that holds the Loadable Expansion Library (module)

ENABLE_DL = on; Whether to make DL () valid.

; The DL () function on a multithreaded server * does not work well,

; For example, IIS or Zeus, and on which it is disabled by default

;;;;;;;;;;;;;;;;

; File uploads;

;;;;;;;;;;;;;;;;

File_uploads = on; Whether to allow HTTP mode file upload

; upload_tmp_dir =; Temp directory for files uploaded by HTTP (use system default if not specified)

Upload_max_filesize = 2M; Maximum license size for uploaded files

; Fopen wrappers;

;;;;;;;;;;;;;;;;;;

Allow_url_fopen = on; Whether to allow URLs as http:. or the file as ftp: ...

;;;;;;;;;;;;;;;;;;;;;;

; Dynamic expansion;

; Dynamic Extensions;

;;;;;;;;;;;;;;;;;;;;;;

; If you want an extension library to load automatically, use the following syntax:

; Extension=modulename.extension

; For example, on Windows,

; Extension=msql.dll

; or under UNIX,

; Extension=msql.so

; Note that this should only be the name of the module and does not require directory information to be placed inside.

; Specify the location of the extension library with the extension_dir above.

; Windows Extensions

; 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, so it's not necessary 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, and so on.

; Turning it off is a good idea to improve efficiency.

; At run time, 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 =; for Unix only, it can also support parameters (default is ' Sendmail-t-i ')

[Debugger]

Debugger.host = localhost

Debugger.port = 7869

debugger.enabled = False

[Logging]

; These configurations indicate the logging mechanism for the sample.

; Look at examples/readme.logging to get more explanations.

; Logging.method = db

; logging.directory =/path/to/log/directory

[Java]

; Java.class.path =. \php_java.jar

; java.home = C:\jdk

; java.library = C:\jdk\jre\bin\hotspot\jvm.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 disallow persistent connections

Uodbc.check_persistent = on; Check if the connection is still available before reuse

Uodbc.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Uodbc.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

UODBC.DEFAULTLRL = 4096; Controls a field of type LONG. Returns the number of bytes of the variable, and 0 represents the pass (? ) 0 means PassThru

Uodbc.defaultbinmode = 1; Controls the binary data. 0 stands for????? 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 disallow persistent connections

Mysql.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Mysql.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

Mysql.default_port =; mysql_connect () default port used, if not set, mysql_connect ()

; The variable will be used $MYSQL _tcp_port, or the MYSQL-TCP entry under/etc/services (Unix),

; Or in the compilation is defined by the Mysql_port (in this order)

; Win32 environment, only mysql_port will be checked.

Mysql.default_socket =; The default socket name for the local MYSQL connection. Empty, use MYSQL built-in values

Mysql.default_host =; Mysql_connect () Default host (not available in safe mode)

Mysql.default_user =; mysql_connect () User name used by default (not valid in Safe mode)

Mysql.default_password =; mysql_connect () default password used (invalid in safe mode)

; Note that saving passwords under this file is usually a bad * idea

; * Any user with PHP access can run

; ' Echocfg_get_var ("Mysql.default_password") ' to show that password!

; And of course, any user who has read the file's power can see that password.

[MSQL]

Msql.allow_persistent = on; Allow or disallow persistent connections

Msql.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Msql.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

[Postgressql]

Pgsql.allow_persistent = on; Allow or disallow persistent connections

Pgsql.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Pgsql.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

[Sybase]

Sybase.allow_persistent = on; Allow or disallow persistent connections

Sybase.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Sybase.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

; sybase.interface_file = "/usr/sybase/interfaces"

Sybase.min_error_severity = 10; Minimum severity of errors displayed

Sybase.min_message_severity = 10; Minimum importance of the displayed message

Sybase.compatability_mode = OFF; Mode compatible with older versions of PHP 3.0. If turned on, this will cause PHP to automatically

; Give them the type of Sybase based on the results,

; Instead of treating them all as strings.

; This compatibility mode will not be kept forever,

; So put your code in the necessary modifications,

; and closes the item.

[SYBASE-CT]

Sybct.allow_persistent = on; Allow or disallow persistent connections

Sybct.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Sybct.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

Sybct.min_server_severity = 10; Minimum severity of errors displayed

Sybct.min_client_severity = 10; Minimum importance of the displayed message

[Bcmath]

Bcmath.scale = 0; The number of 100 decimal digits used for all Bcmath functions is number of decimal digits for all Bcmath functions

[Browscap]

; browscap = Extra/browscap.ini

Browscap = C:\WIN\SYSTEM\inetsrv\browscap.ini

[Informix]

Ifx.default_host =; Ifx_connect () Default host (not available in safe mode)

Ifx.default_user =; Ifx_connect () User name used by default (not valid in Safe mode)

Ifx.default_password =; Ifx_connect () default password used (invalid in safe mode)

Ifx.allow_persistent = on; Allow or disallow persistent connections

Ifx.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Ifx.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

Ifx.textasvarchar = 0; If open, the Select State character returns the contents of a ' text blob ' field instead of its ID

Ifx.byteasvarchar = 0; If open, the Select State character returns the contents of a ' byte blob ' field instead of its ID

Ifx.charasvarchar = 0; Track the space stripped from the fixed-length word Fulieri.

; may be valid for Informix SE users.

Ifx.blobinfile = 0; If open, the contents of text and byte blobs are exported to a file

; Instead of saving to memory.

Ifx.nullformat = 0; Null (NULL) is returned as an empty field, unless it is set to 1.

; In this case (1), NULL is returned as a string null.

[Session]

Session.save_handler = files; control mode for saving/retrieving data

Session.save_path = C:\win\temp; Parameters that are passed to the controller when the Save_handler is set to a file,

; 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 the cookie.

Session.auto_start = 0; Initializing session at request startup

Session.cookie_lifetime = 0; The time to save the cookie in seconds,

; or 0 o'clock until the browser is restarted

Session.cookie_path =/; Valid path for cookies

Session.cookie_domain =; The valid domain of the cookie

Session.serialize_handler = PHP; The controller used to connect the data

; PHP is the standard controller for PHP.

session.gc_probability = 1; ' Garbage collection (defragmentation) ' process by percentage

; The possibility of starting each time the session is initialized.

Session.gc_maxlifetime = 1440; After the number of seconds referred to here, the saved data will be treated as

; ' Fragment (garbage) ' and cleared by the GC process.

Session.referer_check =; Check for HTTP references to invalidate IDs that are included in the additional URLs

session.entropy_length = 0; How many bytes are read from a file

Session.entropy_file =; Specify the session ID to be established here

; Session.entropy_length = 16

; Session.entropy_file =/dev/urandom

Session.cache_limiter = NoCache; Set to {Nocache,private,public} to determine the HTTP

; Caching issues

Session.cache_expire = 180; Document is obsolete after n minutes

Session.use_trans_sid = 1; Use the transitional SID support if the compile-time license

; --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 disallow persistent connections

Mssql.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Mssql.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

Mssql.min_error_severity = 10; Minimum severity of errors displayed

Mssql.min_message_severity = 10; Minimum importance of the displayed message

Mssql.compatability_mode = OFF; Mode compatible with older versions of PHP 3.0.

[Ingres II]

Ii.allow_persistent = on; Allow or disallow persistent connections

Ii.max_persistent =-1; The maximum number of persistent connections. -1 means no limit

Ii.max_links =-1; The maximum number of connections (persistent and non-persistent). -1 means no limit

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"; The default Signio server

Pfpro.defaultport = 443; Default port for connections

Pfpro.defaulttimeout = 30; Default time-out by seconds

; Pfpro.proxyaddress =; IP address of the default proxy (if required)

; Pfpro.proxyport =; The default proxy port

; Pfpro.proxylogon =; Default proxy login (logon username)

; Pfpro.proxypassword =; Password for the default proxy

[Sockets]

Sockets.use_system_read = on; Replace the Php_read () package with the Read () function of the system

; Local Variables: (locally variable)

; Tab-width:4

; End

Tags: PHP programming

Source: PHP configuration file in a detailed

  • 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.