PHP中的php.ini文件详解

php.ini是PHP的初始化配置文件,该文件下内容非常多,进行个性化配置并不方便,所以在进行LNMP环境搭建时我们并没有完全使用它,只使用了其中默认开启的部分配置(该部分配置必须保留,所以PHP配置文件目录下必须有该文件),那么,该文件下到底都包含什么内容呢?小白出于好奇,整理如下:

官方原文:

; NOTE 1: PHP will not create this directory structure automatically.
;         You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
;         use subdirectories for session storage
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
;     session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
; http://php.net/session.save-path
;session.save_path = "/tmp"

; Whether to use strict session mode.
; Strict session mode does not accept uninitialized session ID and regenerate
; session ID if browser sends uninitialized session ID. Strict mode protects
; applications from session fixation via session adoption vulnerability. It is
; disabled by default for maximum compatibility, but enabling it is encouraged.
; https://wiki.php.net/rfc/strict_sessions
session.use_strict_mode = 0

; Whether to use cookies.
; http://php.net/session.use-cookies
session.use_cookies = 1

; http://php.net/session.cookie-secure
;session.cookie_secure =

; This option forces PHP to fetch and use a cookie for storing and maintaining
; not the be-all and end-all of session hijacking defense, but it's a good start.
; http://php.net/session.use-only-cookies
session.use_only_cookies = 1

; Name of the session (used as cookie name).
; http://php.net/session.name
session.name = PHPSESSID

; Initialize session on request startup.
; http://php.net/session.auto-start
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
; http://php.net/session.cookie-lifetime
session.cookie_lifetime = 0

; The path for which the cookie is valid.
; http://php.net/session.cookie-path
session.cookie_path = /

; The domain for which the cookie is valid.
; http://php.net/session.cookie-domain
session.cookie_domain =

; http://php.net/session.cookie-httponly
session.cookie_httponly =

; Handler used to serialize data.  php is the standard serializer of PHP.
; http://php.net/session.serialize-handler
session.serialize_handler = php

; Defines the probability that the 'garbage collection' process is started
; on every session initialization. The probability is calculated by using
; gc_probability/gc_divisor. Where session.gc_probability is the numerator
; and gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request.
; Default Value: 1
; Development Value: 1
; Production Value: 1
; http://php.net/session.gc-probability
session.gc_probability = 1

; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using the following equation:
; gc_probability/gc_divisor. Where session.gc_probability is the numerator and
; session.gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request. Increasing this value to 1000 will give you
; a 0.1% chance the gc will run on any give request. For high volume production servers,
; this is a more efficient approach.
; Default Value: 100
; Development Value: 1000
; Production Value: 1000
; http://php.net/session.gc-divisor
session.gc_divisor = 1000

; http://php.net/session.gc-maxlifetime
session.gc_maxlifetime = 1440

; NOTE: If you are using the subdirectory option for storing session files
;       (see session.save_path above), then garbage collection does *not*
;       happen automatically.  You will need to do your own garbage
;       collection through a shell script, cron entry, or some other method.
;       For example, the following script would is the equivalent of
;       setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
;          find /path/to/sessions -cmin +24 -type f | xargs rm

; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
; http://php.net/session.referer-check
session.referer_check =

; How many bytes to read from the file.
; http://php.net/session.entropy-length
;session.entropy_length = 32

; Specified here to create the session id.
; http://php.net/session.entropy-file
; Defaults to /dev/urandom
; If neither are found at compile time, the default is no entropy file.
; On windows, setting the entropy_length setting will activate the
; Windows random source (using the CryptoAPI)
;session.entropy_file = /dev/urandom

; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
; http://php.net/session.cache-limiter
session.cache_limiter = nocache

; Document expires after n minutes.
; http://php.net/session.cache-expire
session.cache_expire = 180

; trans sid support is disabled by default.
; Use of trans sid may risk your users' security.
; Use this option with caution.
; - User may send URL contains active session ID
;   to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
;   in publicly accessible computer.
; - User may access your site with the same session ID
;   always using URL stored in browser's history or bookmarks.
; http://php.net/session.use-trans-sid
session.use_trans_sid = 0

; Select a hash function for use in generating session ids.
; Possible Values
;   0  (MD5 128 bits)
;   1  (SHA-1 160 bits)
; This option may also be set to the name of any hash function supported by
; the hash extension. A list of available hashes is returned by the hash_algos()
; function.
; http://php.net/session.hash-function
session.hash_function = 0

; Define how many bits are stored in each character when converting
; the binary hash data to something readable.
; Possible values:
;   4  (4 bits: 0-9, a-f)
;   5  (5 bits: 0-9, a-v)
;   6  (6 bits: 0-9, a-z, A-Z, "-", ",")
; Default Value: 4
; Development Value: 5
; Production Value: 5
; http://php.net/session.hash-bits-per-character
session.hash_bits_per_character = 5

; The URL rewriter will look for URLs in a defined set of HTML tags.
; form/fieldset are special; if you include them here, the rewriter will
; add a hidden <input> field with the info which is otherwise appended
; to URLs.  If you want XHTML conformity, remove the form entry.
; Note that all valid entries require a "=", even if no value follows.
; Default Value: "a=href,area=href,frame=src,form=,fieldset="
; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; http://php.net/url-rewriter.tags
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

; Enable upload progress tracking in $_SESSION
; Default Value: On
; Development Value: On
; Production Value: On
; http://php.net/session.upload-progress.enabled
;session.upload_progress.enabled = On

; Cleanup the progress information as soon as all POST data has been read
; (i.e. upload completed).
; Default Value: On
; Development Value: On
; Production Value: On
; http://php.net/session.upload-progress.cleanup
;session.upload_progress.cleanup = On

; A prefix used for the upload progress key in $_SESSION
; Default Value: "upload_progress_"
; Development Value: "upload_progress_"
; Production Value: "upload_progress_"
; http://php.net/session.upload-progress.prefix
;session.upload_progress.prefix = "upload_progress_"

; The index name (concatenated with the prefix) in $_SESSION
; containing the upload progress information
; Default Value: "PHP_SESSION_UPLOAD_PROGRESS"
; Development Value: "PHP_SESSION_UPLOAD_PROGRESS"
; Production Value: "PHP_SESSION_UPLOAD_PROGRESS"
; http://php.net/session.upload-progress.name
;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"

; How frequently the upload progress should be updated.
; Given either in percentages (per-file), or in bytes
; Default Value: "1%"
; Development Value: "1%"
; Production Value: "1%"
; http://php.net/session.upload-progress.freq
;session.upload_progress.freq =  "1%"

; The minimum delay between updates, in seconds
; Default Value: 1
; Development Value: 1
; Production Value: 1
; http://php.net/session.upload-progress.min-freq
;session.upload_progress.min_freq = "1"

[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mssql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
mssql.max_links = -1

; Minimum error severity to display.
mssql.min_error_severity = 10

; Minimum message severity to display.
mssql.min_message_severity = 10

; Compatibility mode with old versions of PHP 3.0.
mssql.compatibility_mode = Off

; Connect timeout
;mssql.connect_timeout = 5

; Query timeout
;mssql.timeout = 60

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textsize = 4096

; Limits the number of records in each batch.  0 = all records in one batch.
;mssql.batchsize = 0

; Specify how datetime and datetim4 columns are returned
; On => Returns data converted to SQL server settings
; Off => Returns values as YYYY-MM-DD hh:mm:ss
;mssql.datetimeconvert = On

; Use NT authentication when connecting to the server
mssql.secure_connection = Off

; Specify max number of processes. -1 = library default
; msdlib defaults to 25
; FreeTDS defaults to 4096
;mssql.max_procs = -1

; Specify client character set.
; If empty or not set the client charset from freetds.conf is used
; This is only used when compiled with FreeTDS
;mssql.charset = "ISO-8859-1"

[Assertion]
; Assert(expr); active by default.
; http://php.net/assert.active
;assert.active = On

; Issue a PHP warning for each failed assertion.
; http://php.net/assert.warning
;assert.warning = On

; Don't bail out by default.
; http://php.net/assert.bail
;assert.bail = Off

; User-function to be called if an assertion fails.
; http://php.net/assert.callback
;assert.callback = 0

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
; http://php.net/assert.quiet-eval
;assert.quiet_eval = 0

[COM]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
; http://php.net/com.typelib-file
;com.typelib_file =

; allow Distributed-COM calls
; http://php.net/com.allow-dcom
;com.allow_dcom = true

; autoregister constants of a components typlib on com_load()
; http://php.net/com.autoregister-typelib
;com.autoregister_typelib = true

; register constants casesensitive
; http://php.net/com.autoregister-casesensitive
;com.autoregister_casesensitive = false

; show warnings on duplicate constant registrations
; http://php.net/com.autoregister-verbose
;com.autoregister_verbose = true

; The default character set code-page to use when passing strings to and from COM objects.
; Default: system ANSI code page
;com.code_page=

[mbstring]
; language for internal character representation.
; This affects mb_send_mail() and mbstrig.detect_order.
; http://php.net/mbstring.language
;mbstring.language = Japanese

; Use of this INI entry is deprecated, use global internal_encoding instead.
; internal/script encoding.
; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*)
; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.
; The precedence is: default_charset < internal_encoding < iconv.internal_encoding
;mbstring.internal_encoding =

; Use of this INI entry is deprecated, use global input_encoding instead.
; http input encoding.
; mbstring.encoding_traslation = On is needed to use this setting.
; If empty, default_charset or input_encoding or mbstring.input is used.
; The precedence is: default_charset < intput_encoding < mbsting.http_input
; http://php.net/mbstring.http-input
;mbstring.http_input =

; Use of this INI entry is deprecated, use global output_encoding instead.
; http output encoding.
; mb_output_handler must be registered as output buffer to function.
; If empty, default_charset or output_encoding or mbstring.http_output is used.
; The precedence is: default_charset < output_encoding < mbstring.http_output
; To use an output encoding conversion, mbstring's output handler must be set
; otherwise output encoding conversion cannot be performed.
; http://php.net/mbstring.http-output
;mbstring.http_output =

; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
;       portable libs/applications.
; http://php.net/mbstring.encoding-translation
;mbstring.encoding_translation = Off

; automatic encoding detection order.
; "auto" detect order is changed according to mbstring.language
; http://php.net/mbstring.detect-order
;mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
; http://php.net/mbstring.substitute-character
;mbstring.substitute_character = none

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
; http://php.net/mbstring.func-overload
;mbstring.func_overload = 0

; enable strict encoding detection.
; Default: Off
;mbstring.strict_detection = On

; This directive specifies the regex pattern of content types for which mb_output_handler()
; is activated.
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
;mbstring.http_output_conv_mimetype=

[gd]
; Tell the jpeg decode to ignore warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
; http://php.net/gd.jpeg-ignore-warning
;gd.jpeg_ignore_warning = 0

[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
; http://php.net/exif.encode-unicode
;exif.encode_unicode = ISO-8859-15

; http://php.net/exif.decode-unicode-motorola
;exif.decode_unicode_motorola = UCS-2BE

; http://php.net/exif.decode-unicode-intel
;exif.decode_unicode_intel    = UCS-2LE

; http://php.net/exif.encode-jis
;exif.encode_jis =

; http://php.net/exif.decode-jis-motorola
;exif.decode_jis_motorola = JIS

; http://php.net/exif.decode-jis-intel
;exif.decode_jis_intel    = JIS

[Tidy]
; The path to a default tidy configuration file to use when using tidy
; http://php.net/tidy.default-config
;tidy.default_config = /usr/local/lib/php/default.tcfg

; Should tidy clean and repair output automatically?
; WARNING: Do not use this option if you are generating non-html content
; such as dynamic images
; http://php.net/tidy.clean-output
tidy.clean_output = Off

[soap]
; Enables or disables WSDL caching feature.
; http://php.net/soap.wsdl-cache-enabled
soap.wsdl_cache_enabled=1

; Sets the directory name where SOAP extension will put cache files.
; http://php.net/soap.wsdl-cache-dir
soap.wsdl_cache_dir="/tmp"

; (time to live) Sets the number of second while cached file will be used
; instead of original one.
; http://php.net/soap.wsdl-cache-ttl
soap.wsdl_cache_ttl=86400

; Sets the size of the cache limit. (Max. number of WSDL files to cache)
soap.wsdl_cache_limit = 5

[sysvshm]
; A default size of the shared memory segment
;sysvshm.init_mem = 10000

[ldap]
; Sets the maximum number of open links or -1 for unlimited.
ldap.max_links = -1

[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open

; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=

; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.modes_dir=

[dba]
;dba.default_handler=

[opcache]
; Determines if Zend OPCache is enabled
;opcache.enable=0

; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0

; The OPcache shared memory storage size.
;opcache.memory_consumption=64

; The amount of memory for interned strings in Mbytes.
;opcache.interned_strings_buffer=4

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
;opcache.max_accelerated_files=2000

; The maximum percentage of "wasted" memory until a restart is scheduled.
;opcache.max_wasted_percentage=5

; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
;opcache.use_cwd=1

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
;opcache.validate_timestamps=1

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
;opcache.revalidate_freq=2

; Enables or disables file search in include_path optimization
;opcache.revalidate_path=0

; If disabled, all PHPDoc comments are dropped from the code to reduce the
; size of the optimized code.
;opcache.save_comments=1

; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
; may be always stored (save_comments=1), but not loaded by applications
; that don't need them anyway.
;opcache.load_comments=1

; If enabled, a fast shutdown sequence is used for the accelerated code
;opcache.fast_shutdown=0

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=0

; A bitmask, where each bit enables or disables the appropriate OPcache
; passes
;opcache.optimization_level=0xffffffff

;opcache.inherited_hack=1
;opcache.dups_fix=0

; The location of the OPcache blacklist file (wildcards allowed).
; Each OPcache blacklist file is a text file that holds the names of files
; that should not be accelerated. The file format is to add each filename
; to a new line. The filename may be a full path or just a file prefix
; (i.e., /var/www/x  blacklists all the files and directories in /var/www
; that start with 'x'). Line starting with a ; are ignored (comments).
;opcache.blacklist_filename=

; Allows exclusion of large files from being cached. By default all files
; are cached.
;opcache.max_file_size=0

; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
;opcache.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180

; OPcache error_log file name. Empty string assumes "stderr".
;opcache.error_log=

; All OPcache errors go to the Web server log.
; By default, only fatal errors (level 0) or errors (level 1) are logged.
; You can also enable warnings (level 2), info messages (level 3) or
; debug messages (level 4).
;opcache.log_verbosity_level=1

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=

; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0

; Validate cached file permissions.
; opcache.validate_permission=0

; Prevent name collisions in chroot'ed environment.
; opcache.validate_root=0

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
;openssl.cafile=

; If openssl.cafile is not specified or if the CA file is not found, the
; directory pointed to by openssl.capath is searched for a suitable
; certificate. This value must be a correctly hashed certificate directory.
; Most users should not specify a value for this directive as PHP will
; attempt to use the OS-managed cert stores in its absence. If specified,
; this value may still be overridden on a per-stream basis via the "capath"
; SSL stream context option.
;openssl.capath=

; Local Variables:
; tab-width: 4
; End:

译文:

        ; PHP还是一个不断发展的工具,其功能还在不断地删减
  ; 而php.ini的设置更改可以反映出相当的变化,
  ; 在使用新的PHP版本前,研究一下php.ini会有好处的
  ;;;;;;;;;;;;;;;;;;;
  ; 关于这个文件 ;
  ;;;;;;;;;;;;;;;;;;;
  ; 这个文件控制了PHP许多方面的观点.为了让PHP读取这个文件,它必须被命名为
  ; 'php.ini'.PHP 将在这些地方依次查找该文件:当前工作目录;环境变量PHPRC
  ; 指明的路径;编译时指定的路径.
  ; 在windows下,编译时的路径是Windows安装目录.
  ; 在命令行模式下,php.ini的查找路径可以用 -c 参数替代.
  ; 该文件的语法非常简单.空白字符和用分号';'开始的行被简单地忽略(就象你可能
  ; 猜到的一样). 章节标题(例如 : [Foo])也被简单地忽略,即使将来它们可能
  ; 有某种的意义.
  ;
  ; 指示被指定使用如下语法:
  ; 指示标识符 = 值
  ; directive = value
  ; 指示标识符 是 *大小写敏感的* - foo=bar 不同于 FOO = bar.
  ;
  ; 值可以是一个字符串,一个数字,一个 PHP 常量 (如: E_ALL or M_PI), INI 常量中的
  ; 一个 (On, Off, True, False, Yes, No and None) ,或是一个表达式
  ; (如: E_ALL & ~E_NOTICE), 或是用引号括起来的字符串("foo").
  ;
  ; INI 文件的表达式被限制于位运算符和括号.
  ; | bitwise OR
  ; & bitwise AND
  ; ~ bitwise NOT
  ; ! boolean NOT
  ;
  ; 布尔标志可用 1, On, True or Yes 这些值置于开的状态.
  ; 它们可用 0, Off, False or No 这些值置于关的状态.
  ;
  ; 一个空字符串可以用在等号后不写任何东西表示,或者用 None 关键字:
  ;
  ; foo = ; 将foo置为空字符串
  ; foo = none ; 将foo置为空字符串
  ; foo = "none" ; 将foo置为字符串'none'
  ;
  ; 如果你值设置中使用常量,而这些常量属于动态调入的扩展库(不是 PHP 的扩展,就是
  ; Zend 的扩展),你仅可以调入这些扩展的行*之后*使用这些常量.
  ;
  ; 所有在 php.ini-dist 文件里设定的值与内建的默认值相同(这是说,如果 php.ini
  ; 没被使用或者你删掉了这些行,默认值与之相同).
  ;;;;;;;;;;;;;;;;;;;;
  ; 语言选项 ;
  ;;;;;;;;;;;;;;;;;;;;
  engine = On
  ; 使 PHP scripting language engine(PHP 脚本语言引擎)在 Apache下有效.
  short_open_tag = On
  ; 允许  tags 将被识别.
  asp_tags = Off
  ; 允许ASP-style  tags
  precision = 14
  ; 浮点类型数显示时的有效位数
  y2k_compliance = Off
  ; 是否打开 2000年适应 (可能在非Y2K适应的浏览器中导致问题)
  output_buffering = Off
  ; 输出缓存允许你甚至在输出正文内容之后发送 header(标头,包括cookies)行
  ; 其代价是输出层减慢一点点速度.你可以使用输出缓存在运行时打开输出缓存,
  ; 或者在这里将指示设为 On 而使得所有文件的输出缓存打开.
  output_handler = ; 你可以重定向你的脚本的所有输出到一个函数,
  ; 那样做可能对处理或以日志记录它有用.
  ; 例如若你将这个output_handler 设为"ob_gzhandler",
  ; 则输出会被透明地为支持gzip或deflate编码的浏览器压缩.
  ; 设一个输出处理器自动地打开输出缓冲.
  implicit_flush = Off
  ; 强制flush(刷新)让PHP 告诉输出层在每个输出块之后自动刷新自身数据.
  ; 这等效于在每个 print() 或 echo() 调用和每个 HTML 块后调用flush()函数.
  ; 打开这项设置会导致严重的运行时冲突,建议仅在debug过程中打开.
  allow_call_time_pass_reference = On
  ; 是否让强迫函数调用时按引用传递参数.这一方法遭到抗议,
  ; 并可能在将来版本的PHP/Zend里不再支持.
  ; 受到鼓励的指定哪些参数按引用传递的方法是在函数声明里.
  ; 你被鼓励尝试关闭这一选项并确认你的脚本仍能正常工作,以保证在将来版本的语言里
  ; 它们仍能工作.(你将在每次使用该特点时得到一个警告,而参数将按值而不是按引用
  ; 传递).
  ; 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.
  ; 该指示包含用逗号分隔的前缀列表.安全模式中,用户仅可以替换
  ; 以在此列出的前缀开头的环境变量的值.
  ; 默认地,用户将仅能 设定以PHP_开头的环境变量,(如: PHP_FOO=BAR).
  ; 注意: 如果这一指示为空,PHP 将让用户更改任意环境变量!
  safe_mode_protected_env_vars = LD_LIBRARY_PATH
  ; 这条指示包含一个用逗号分隔的环境变量列表,那是最终用户将不能用putenv () 更改的.
  ; 这些变量甚至在safe_mode_allowed_env_vars 设置为允许的情况下得到保护.
  disable_functions =
  ; 这条指示让你可以为了安全的原因让特定函数失效.
  ; 它接受一个用逗号分隔的函数名列表.
  ; 这条指示 *不受* 安全模式是否打开的影响.
  ; 语法高亮模式的色彩.
  ; 只要能被接受的东西就能工作.
  highlight.string = #DD0000
  highlight.comment = #FF8000
  highlight.keyword = #007700
  highlight.bg = #FFFFFF
  highlight.default = #0000BB
  highlight.html = #000000
  ; Misc 杂项
  expose_php = Off
  ; 决定 PHP 是否标示它装在服务器上的事实(例如:加在它 —PHP—给Web服务
  ; 发送的信号上).
  ; (我个人的意见,在出现什么power-by的header的时候,把这关掉.)
  ; 它不会有安全上的威胁, 但它使检查你的服务器上是否安装了PHP成为了可能.
  ;;;;;;;;;;;;;;;;;;;
  ; Resource Limits ;
  ;;;;;;;;;;;;;;;;;;;
  max_execution_time = 30 ; 每个脚本的最大执行时间, 按秒计
  memory_limit = 8388608 ; 一个脚本最大可使用的内存总量 (这里是8MB)
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ; Error handling and logging ;
  ; 出错控制和登记 ;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ; 错误报告是按位的.或者将数字加起来得到想要的错误报告等级.
  ; E_ALL - 所有的错误和警告
  ; E_ERROR - 致命性运行时错
  ; E_WARNING - 运行时警告(非致命性错)
  ; E_PARSE - 编译时解析错误
  ; E_NOTICE - 运行时提醒(这些经常是是你的代码的bug引起的,
  ;也可能是有意的行为造成的.(如:基于未初始化的变量自动初始化为一个
  ;空字符串的事实而使用一个未初始化的变量)
  ; E_CORE_ERROR - 发生于PHP启动时初始化过程中的致命错误
  ; E_CORE_WARNING - 发生于PHP启动时初始化过程中的警告(非致命性错)
  ; E_COMPILE_ERROR - 编译时致命性错
  ; E_COMPILE_WARNING - 编译时警告(非致命性错)
  ; E_USER_ERROR - 用户产生的出错消息
  ; E_USER_WARNING - 用户产生的警告消息
  ; E_USER_NOTICE - 用户产生的提醒消息
  ; 例子:
  ; error_reporting = E_ALL & ~E_NOTICE ; 显示所有的错误,除了提醒
  ; error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; 仅显示错误
  error_reporting = E_ALL & ~E_NOTICE ; 显示所有的错误,除了提醒
  display_errors = On ; 显示出错误信息(作为输出的一部分)
  ; 在最终发布的web站点上,强烈建议你关掉这个特性,并使用
  ; 错误日志代替(参看下面).
  ; 在最终发布的web站点继续让 display_errors 有效可能
  ; 暴露一些有关安全的信息,例如你的web服务上的文件路径、
  ; 你的数据库规划或别的信息.
  display_startup_errors = Off ; 甚至当display_erroes打开了,发生于PHP的启动的步骤中
  ; 的错误也不会被显示.
  ; 强烈建议保持使 display_startup_errors 关闭,
  ; 除了在改错过程中.
  log_errors = Off ; 在日志文件里记录错误(服务器指定的日志,stderr标准错误输出,或error_log(下面的))
  ; 正如上面说明的那样,强烈建议你在最终发布的web站点以日志记录错误
  ; 取代直接错误输出.
  track_errors = Off ; 保存最近一个 错误/警告 消息于变量 $php_errormsg (boolean)
  ;error_prepend_string = "" ; 于错误信息前输出的字符串
  ;error_append_string = "" ; 于错误信息后输出的字符串
  ;error_log = filename ; 记录错误日志于指定文件
  ;error_log = syslog ; 记录错误日志于系统日志 syslog (NT 下的事件日志, Windows 95下无效)
  warn_plus_overloading = Off ; 当将‘+’用于字符串时警告
  ;;;;;;;;;;;;;;;;;
  ; Data Handling ;
  ;;;;;;;;;;;;;;;;;
  variables_order = "EGPCS" ; 这条指示描述了PHP 记录
  ; GET, POST, Cookie, Environment and Built-in 这些变量的顺序.
  ; (以 G, P, C, E & S 代表,通常以 EGPCS 或 GPC 的方式引用).
  ; 按从左到右记录,新值取代旧值.
  register_globals = On ; 是否将这些 EGPCS 变量注册为全局变量.
  ; 若你不想让用户数据不在全局范围内混乱的话,你可能想关闭它.
  ; 这和 track_vars 连起来用更有意义 — 这样你可以通过
  ; $HTTP_*_VARS[] 数组访问所有的GPC变量.
  register_argc_argv = On ; 这条指示告诉 PHP 是否声明 argv和argc 变量
  ; (注:这里argv为数组,argc为变量数)
  ; (其中包含用GET方法传来的数据).
  ; 若你不想用这些变量,你应当关掉它以提高性能.
  track_vars = On ; 使$HTTP_*_VARS[]数组有效,这里*在使用时用
  ; ENV, POST, GET, COOKIE or SERVER替换
  post_max_size = 8M ; PHP将接受的POST数据最大大小.
  gpc_order = "GPC" ; 这条指示被人反对.用 variables_order 代替.
  ; Magic quotes
  magic_quotes_gpc = On ; 在输入的GET/POST/Cookie数据里使用魔术引用
  ; (原文就这样,呵呵,所谓magic quotes 应该是指用转义符加在引用性的控制字符上,如 '....)
  magic_quotes_runtime= Off ; 对运行时产生的数据使用魔术引用,
  ; 例如:用SQL查询得到的数据,用exec()函数得到的数据,等等
  magic_quotes_sybase = Off ; 采用 Sybase形式的魔术引用(用 '' 脱出 ' 而不用 ')
  ; 自动在 PHP 文档之前和之后添加文件
  auto_prepend_file =
  auto_append_file =
  ; 象4.04b4一样,PHP 默认地总是在 “Content-type:” 头标输出一个字符的编码方式.
  ; 让输出字符集失效,只要设置为空.
  ; PHP 的内建默认值是 text/html
  default_mimetype = "text/html"
  ;default_charset = "iso-8859-1"
  ;;;;;;;;;;;;;;;;;;;;;;;;;
  ; Paths and Directories ;
  ;;;;;;;;;;;;;;;;;;;;;;;;;
  include_path = ; include 路径设置,UNIX: "/path1:/path2" Windows: "path1;path2"
  doc_root = ; php 页面的根路径,仅在非空时有效
  user_dir = ; 告知 php 在使用 /~username 打开脚本时到哪个目录下去找,仅在非空时有效
  ;upload_tmp_dir = ; 存放用HTTP协议上载的文件的临时目录(在没指定时使用系统默认的)
  upload_max_filesize = 2097152 ; 文件上载默认地限制为2 Meg
  extension_dir = c:php ; 存放可加载的扩充库(模块)的目录
  enable_dl = On ; 是否使dl()有效.
  ; 在多线程的服务器上 dl()函数*不能*很好地工作,
  ; 例如IIS or Zeus,并在其上默认为禁止
  ;;;;;;;;;;;;;;;;
  ; File Uploads ;
  ;;;;;;;;;;;;;;;;
  file_uploads = On ; 是否允许HTTP方式文件上载
  ;upload_tmp_dir = ; 用于HTTP上载的文件的临时目录(未指定则使用系统默认)
  upload_max_filesize = 2M ; 上载文件的最大许可大小
  ; Fopen wrappers ;
  ;;;;;;;;;;;;;;;;;;
  allow_url_fopen = On ; 是否允许把URLs当作http:.. 或把文件当作ftp:...
  ;;;;;;;;;;;;;;;;;;;;;;
  ; 动态扩展 ;
  ; Dynamic Extensions ;
  ;;;;;;;;;;;;;;;;;;;;;;
  ; 若你希望一个扩展库自动加载,用下面的语法:
  ; extension=modulename.extension
  ; 例如,在windows上,
  ; extension=msql.dll
  ; or 在UNIX下,
  ; extension=msql.so
  ; 注意,这只应当是模块的名字,不需要目录信息放在里面.
  ; 用上面的 extension_dir 指示指定扩展库的位置.
  ;Windows 扩展
  ;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
  ; 注意, MySQL的支持现在是内建的,因此,不需要用它的dll
  ;;;;;;;;;;;;;;;;;;;
  ; 模块设定 ;
  ; Module Settings ;
  ;;;;;;;;;;;;;;;;;;;
  [Syslog]
  define_syslog_variables = Off ; 是否定义各种的系统日志变量
  ; 如:$LOG_PID, $LOG_CRON, 等等.
  ; 关掉它是个提高效率的好主意.
  ; 运行时,你可以调用函数define_syslog_variables(),来定义这些变量
  [mail function]
  SMTP = localhost ;仅用于win32系统
  sendmail_from = me@localhost.com ;仅用于win32系统
  ;sendmail_path = ;仅用于unix, 也可支持参数(默认的是'sendmail -t -i')
  [Debugger]
  debugger.host = localhost
  debugger.port = 7869
  debugger.enabled = False
  [Logging]
  ; 这些配置指示用于示例的日志记录机制.
  ; 看 examples/README.logging 以得到更多的解释
  ;logging.method = db
  ;logging.directory = /path/to/log/directory
  [Java]
  ;java.class.path = .php_java.jar
  ;java.home = c:jdk
  ;java.library = c:jdkjreinhotspotjvm.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 ; 允许或禁止 持久连接
  uodbc.check_persistent = On ; 在重用前检查连接是否还可用
  uodbc.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  uodbc.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  uodbc.defaultlrl = 4096 ; 控制 LONG 类型的字段.返回变量的字节数,0 代表通过(?)0 means passthru
  uodbc.defaultbinmode = 1 ; 控制 二进制数据.0 代表?????Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char
  ; 见有关 odbc_binmode 和 odbc_longreadlen 的文档以得到 uodbc.defaultlrl 和 uodbc.defaultbinmode 的解释.
  [MySQL]
  mysql.allow_persistent = On ; 允许或禁止 持久连接
  mysql.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  mysql.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  mysql.default_port = ; mysql_connect() 使用的默认端口,如不设置,mysql_connect()
  ; 将使用变量 $MYSQL_TCP_PORT,或在/etc/services 下的mysql-tcp 条目(unix),
  ; 或在编译是定义的 MYSQL_PORT(按这样的顺序)
  ; Win32环境,将仅检查MYSQL_PORT.
  mysql.default_socket = ; 用于本地 MySql 连接的默认的套接字名.为空,使用 MYSQL 内建值
  mysql.default_host = ; mysql_connect() 默认使用的主机(安全模式下无效)
  mysql.default_user = ; mysql_connect() 默认使用的用户名(安全模式下无效)
  mysql.default_password = ; mysql_connect() 默认使用的密码(安全模式下无效)
  ; 注意,在这个文件下保存密码通常是一个*坏*主意
  ; *任何*可以使用PHP访问的用户可以运行
  ; 'echo cfg_get_var("mysql.default_password")'来显示那个密码!
  ; 而且当然地,任何有读该文件权力的用户也能看到那个密码.
  [mSQL]
  msql.allow_persistent = On ; 允许或禁止 持久连接
  msql.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  msql.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  [PostgresSQL]
  pgsql.allow_persistent = On ; 允许或禁止 持久连接
  pgsql.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  pgsql.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  [Sybase]
  sybase.allow_persistent = On ; 允许或禁止 持久连接
  sybase.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  sybase.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  ;sybase.interface_file = "/usr/sybase/interfaces"
  sybase.min_error_severity = 10 ; 显示的错误的最低严重性
  sybase.min_message_severity = 10 ; 显示的消息的最低重要性
  sybase.compatability_mode = Off ; 与旧版的PHP 3.0 兼容的模式.若打开,这将导致 PHP 自动地
  ; 把根据结果的 Sybase 类型赋予它们,
  ; 而不是把它们全当成字符串.
  ; 这个兼容模式不会永远留着,
  ; 因此,将你的代码进行需要的修改,
  ; 并将该项关闭.
  [Sybase-CT]
  sybct.allow_persistent = On ; 允许或禁止 持久连接
  sybct.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  sybct.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  sybct.min_server_severity = 10 ; 显示的错误的最低严重性
  sybct.min_client_severity = 10 ; 显示的消息的最低重要性
  [bcmath]
  bcmath.scale = 0 ; 用于所有bcmath函数的10十进制数数字的个数number of decimal digits for all bcmath functions
  [browscap]
  ;browscap = extra/browscap.ini
  browscap = C:WINSYSTEMinetsrvrowscap.ini
  [Informix]
  ifx.default_host = ; ifx_connect() 默认使用的主机(安全模式下无效)
  ifx.default_user = ; ifx_connect() 默认使用的用户名(安全模式下无效)
  ifx.default_password = ; ifx_connect() 默认使用的密码(安全模式下无效)
  ifx.allow_persistent = On ; 允许或禁止 持久连接
  ifx.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  ifx.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  ifx.textasvarchar = 0 ; 若打开,select 状态符返回一个 ‘text blob’字段的内容,而不是它的id
  ifx.byteasvarchar = 0 ; 若打开,select 状态符返回一个 ‘byte blob’字段的内容,而不是它的id
  ifx.charasvarchar = 0 ; 追踪从固定长度的字符列里剥离的空格.
  ; 可能对 Informix SE 用户有效.
  ifx.blobinfile = 0 ; 若打开,text和byte blobs 的内容被导出到一个文件
  ; 而不是保存到内存.
  ifx.nullformat = 0 ; NULL(空)被作为空字段返回,除非,这里被设为1.
  ; 这种情况下(为1),NULL作为字串NULL返回.
  [Session]
  session.save_handler = files ; 用于保存/取回数据的控制方式
  session.save_path = C:win        emp ; 在 save_handler 设为文件时传给控制器的参数,
  ; 这是数据文件将保存的路径.
  session.use_cookies = 1 ; 是否使用cookies
  session.name = PHPSESSID
  ; 用在cookie里的session的名字
  session.auto_start = 0 ; 在请求启动时初始化session
  session.cookie_lifetime = 0 ; 为按秒记的cookie的保存时间,
  ; 或为0时,直到浏览器被重启
  session.cookie_path = / ; cookie的有效路径
  session.cookie_domain = ; cookie的有效域
  session.serialize_handler = php ; 用于连接数据的控制器
  ; php是 PHP 的标准控制器.
  session.gc_probability = 1 ; 按百分比的'garbage collection(碎片整理)'进程
  ; 在每次 session 初始化的时候开始的可能性.
  session.gc_maxlifetime = 1440 ; 在这里数字所指的秒数后,保存的数据将被视为
  ; '碎片(garbage)'并由gc 进程清理掉.
  session.referer_check = ; 检查 HTTP引用以使额外包含于URLs中的ids无效
  session.entropy_length = 0 ; 从文件中读取多少字节
  session.entropy_file = ; 指定这里建立 session id
  ; session.entropy_length = 16
  ; session.entropy_file = /dev/urandom
  session.cache_limiter = nocache ; 设为{nocache,private,public},以决定 HTTP 的
  ; 缓存问题
  session.cache_expire = 180 ; 文档在 n 分钟后过时
  session.use_trans_sid = 1 ; 使用过渡性的 sid 支持,若编译时许可了
  ; --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 ; 允许或禁止 持久连接
  mssql.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  mssql.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  mssql.min_error_severity = 10 ; 显示的错误的最低严重性
  mssql.min_message_severity = 10 ; 显示的消息的最低重要性
  mssql.compatability_mode = Off ; 与旧版的PHP 3.0 兼容的模式.
  [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 ; 允许或禁止 持久连接
  ii.max_persistent = -1 ; 持久连接的最大数.-1 代表无限制
  ii.max_links = -1 ; 连接的最大数目(持久和非持久).-1 代表无限制
  ii.default_database = ; 默认 database (format : [node_id::]dbname[/srv_class]
  ii.default_user = ; 默认 user
  ii.default_password = ; 默认 password
  [Verisign Payflow Pro]
  pfpro.defaulthost = "test.signio.com" ; 默认的 Signio 服务器
  pfpro.defaultport = 443 ; 连接的默认端口
  pfpro.defaulttimeout = 30 ; 按秒计的默认超时时间
  ; pfpro.proxyaddress = ; 默认的代理的 IP 地址(如果需要)
  ; pfpro.proxyport = ; 默认的代理的端口
  ; pfpro.proxylogon = ; 默认的代理的登录(logon 用户名)
  ; pfpro.proxypassword = ; 默认的代理的密码
  [Sockets]
  sockets.use_system_read = On ; 使用系统的read() 函数替代 php_read()封装
  ; Local Variables: (局部变量)
  ; tab-width: 4
  ; End:

转载于:https://my.oschina.net/adailinux/blog/1507192

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值