[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; This file controls many aspects of PHP's behavior. In order for PHP to
; read it, it must be named 'php.ini'. PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory. The
; path in which the php.ini file is looked for can be overridden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple. Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
; foo = ; sets foo to an empty string
; foo = none ; sets foo to an empty string
; foo = "none" ; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a
; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants *after* the line that loads the extension.
;
;
;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
; This is the recommended, PHP 5-style version of the php.ini-dist file. It
; sets some non standard settings, that make PHP more efficient, more secure,
; and encourage cleaner coding.
;
; The price is that with these settings, PHP may be incompatible with some
; applications, and sometimes, more difficult to develop with. Using this
; file is warmly recommended for production sites. As all of the changes from
; the standard settings are thoroughly documented, you can go over each one,
; and decide whether you want to use it or not.
;
; For general information about the php.ini file, please consult the php.ini-dist
; file, included in your PHP distribution.
;
; This file is different from the php.ini-dist file in the fact that it features
; different values for several directives, in order to improve performance, while
; possibly breaking compatibility with the standard out-of-the-box behavior of
; PHP. Please make sure you read what's different, and modify your scripts
; accordingly, if you decide to use this file instead.
;
; - register_long_arrays = Off [Performance]
; Disables registration of the older (and deprecated) long predefined array
; variables ($HTTP_*_VARS). Instead, use the superglobals that were
; introduced in PHP 4.1.0
; - display_errors = Off [Security]
; With this directive set to off, errors that occur during the execution of
; scripts will no longer be displayed as a part of the script output, and thus,
; will no longer be exposed to remote users. With some errors, the error message
; content may expose information about your script, web server, or database
; server that may be exploitable for hacking. Production sites should have this
; directive set to off.
; - log_errors = On [Security]
; This directive complements the above one. Any errors that occur during the
; execution of your script will be logged (typically, to your server's error log,
; but can be configured in several ways). Along with setting display_errors to off,
; this setup gives you the ability to fully understand what may have gone wrong,
; without exposing any sensitive information to remote users.
; - output_buffering = 4096 [Performance]
; Set a 4KB output buffer. Enabling output buffering typically results in less
; writes, and sometimes less packets sent on the wire, which can often lead to
; better performance. The gain this directive actually yields greatly depends
; on which Web server you're working with, and what kind of scripts you're using.
; - register_argc_argv = Off [Performance]
; Disables registration of the somewhat redundant $argv and $argc global
; variables.
; - magic_quotes_gpc = Off [Performance]
; Input data is no longer escaped with slashes so that it can be sent into
; SQL databases without further manipulation. Instead, you should use the
; database vendor specific escape string function on each input element you
; wish to send to a database.
; - variables_order = "GPCS" [Performance]
; The environment variables are not hashed into the $_ENV. To access
; environment variables, you can use getenv() instead.
; - error_reporting = E_ALL [Code Cleanliness, Security(?)]
; By default, PHP suppresses errors of type E_NOTICE. These error messages
; are emitted for non-critical errors, but that could be a symptom of a bigger
; problem. Most notably, this will cause error messages about the use
; of uninitialized variables to be displayed.
; - allow_call_time_pass_reference = Off [Code cleanliness]
; It's not possible to decide to force a variable to be passed by reference
; when calling a function. The PHP 4 style to do this is by making the
; function require the relevant argument by reference.
; - short_open_tag = Off [Portability]
; Using short tags is discouraged when developing code meant for redistribution
; since short tags may not be supported on the target server.
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
; Enable the PHP scripting language engine under Apache.
engine = On
; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode = Off
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = Off
; Allow ASP-style <% %> tags.
asp_tags = Off
; The number of significant digits displayed in floating point numbers.
precision = 14
; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
y2k_compliance = On
; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit. You can enable output buffering during runtime by calling the output
; buffering functions. You can also enable output buffering for all files by
; setting this directive to On. If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = 4096
; You can redirect all of the output of your scripts to a function. For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
;
PHP.ini研究 php.ini中文版
需积分: 0 123 浏览量
更新于2009-06-24
收藏 65KB RAR 举报
《PHP.ini深度解析——中文版指南》
PHP作为一款广泛使用的服务器端脚本语言,其配置文件php.ini在运行环境中起着至关重要的作用。它控制着PHP引擎的行为,包括错误处理、内存分配、函数启用与禁用等核心功能。这份压缩包提供了不同版本的php.ini文件,以及中文翻译版,对于初学者和进阶者来说,是深入理解PHP配置的宝贵资源。
我们来看php.ini文件的基本结构。php.ini文件由一系列指令构成,每个指令代表一个配置项,例如`display_errors`用于控制是否在页面上显示错误信息。每条指令后面跟着它的值,如`on`或`off`来表示启用或禁用。部分指令还允许指定数值,例如`memory_limit`用于设置PHP脚本的最大内存消耗。
接着,我们关注一些重要的配置段落。"PHP核心"部分包含了PHP运行时的基础设定,如`extension_dir`指定了扩展库的位置,`date.timezone`用于设定默认的时区。"PHP安全"相关的配置,如`register_globals`已经默认被禁用,以增强应用的安全性。"错误报告"则涉及`error_reporting`和`log_errors`,它们分别控制错误的显示级别和日志记录。
"性能优化"是另一个关键领域。`max_execution_time`定义了脚本的最大执行时间,防止因无限循环等问题导致服务器挂起。`post_max_size`和`upload_max_filesize`限制了POST数据和上传文件的大小,避免服务器资源被大文件消耗殆尽。
PHP的扩展功能,如MySQL支持,是由`extension=php_mysql.dll`这样的指令启用的。这里包含了各种数据库连接、加密、图像处理等扩展。值得注意的是,不同的PHP版本可能支持不同的扩展,因此在升级或迁移时需留意。
对于中文环境的开发者,php.ini中的`charset`配置项用于设置默认字符集,通常设置为`UTF-8`以兼容多语言环境。而`mbstring.internal_encoding`则影响多字节字符串处理。
理解php.ini文件的加载过程也非常重要。PHP会按照特定顺序查找php.ini文件,一般是在系统目录、PHP安装目录以及web服务器配置中指定的路径。通过`phpinfo()`函数可以查看当前生效的php.ini位置和配置详情。
深入理解并适当调整php.ini,能够提升PHP应用程序的性能、安全性以及用户体验。这个压缩包提供的多版本和中文版php.ini,无疑是学习和实践这一过程的理想辅助工具。希望这份指南能帮助你更好地驾驭PHP的配置世界,让开发更加得心应手。

流萤2016
- 粉丝: 5
最新资源
- 基于单片机的温度测量装置设计-学位论文(1).doc
- 数据库设计与开发--ORACLE数据库实例管理(1).ppt
- 计算机系统结构(课后的习题答案)打印版(1).doc
- 谈计算机软件开发中Java编程语言的应用(1).docx
- 计算机病毒及防范措施(1).docx
- 毕业设计(论文)--基于单片机的洗衣机智能控制系统(1).doc
- 计算机系统的物理安全(1).ppt
- 工作计划之软件测试实习计划书(1).docx
- 信息化教学手段在高职教育教学中的研究与应用(1).docx
- 浅谈中职学校的计算机教学李庆伟(1).docx
- 大数据环境下云计算对电子商务的作用.pdf
- 能源环境工程及自动化专业未来就业前景就业方向薪资待遇分析【原创】(1).docx
- 实用型配电自动化管理模式研究(1).docx
- 江西省社会信息化水平的测算论文(1).doc
- 基于大数据环境下的高职院校计算机教学改革措施评价(1).docx
- 单片微型计算机原理胡乾斌课后的习题答案(1).doc