Home Backend Development PHP Tutorial php-5.2下php.ini 中文版配置说明_PHP

php-5.2下php.ini 中文版配置说明_PHP

Jun 01, 2016 pm 12:24 PM
php.ini Chinese Version

;;;;;;;;;;;;
;; 语法 ;;

; 该文件的语法非常简单。空白字符和以分号开始的行被简单地忽略。
; 章节标题(例如: [php])也被简单地忽略,即使将来它们可能有某种意义。

; 设置指令的格式如下:
; directive = value
; 指令名(directive)是大小写敏感的!所以"foo=bar"不同于"FOO=bar"。
; 值(value)可以是:
; 1. 用引号界定的字符串(如:"foo")
; 2. 一个数字(整数或浮点数,如:0, 1, 34, -1, 33.55)
; 3. 一个PHP常量(如:E_ALL, M_PI)
; 4. 一个INI常量(On, Off, none)
; 5. 一个表达式(如:E_ALL & ~E_NOTICE)

; INI文件中的表达式仅使用:位运算符、逻辑非、圆括号:
; | 位或
; & 位与
; ~ 位非
; ! 逻辑非

; 布尔标志用 On 表示打开,用 Off 表示关闭。

; 一个空字符串可以用在等号后不写任何东西表示,或者用 none 关键字:
; foo = ; 将foo设为空字符串
; foo = none ; 将foo设为空字符串
; foo = "none" ; 将foo设为字符串'none'

; 如果你在指令值中使用动态扩展(PHP扩展或Zend扩展)中的常量,
; 那么你只能在加载这些动态扩展的指令行之后使用这些常量。



;; httpd.conf ;;

; 还可以在httpd.conf中覆盖php.ini的值,以进行更灵活的配置:
; php_value name value ;设置非bool型的指令,将value设为none则清除先前的设定
; php_flag name on|off ;仅用于设置bool型的指令

; PHP常量(如E_ALL)仅能在php.ini中使用,在httpd.conf中必须使用相应的掩码值。
; 带"SYS"标志的指令只能在httpd.conf中的全局配置部分使用。

;[2007-4-9日更新,增加了更多关于PHP6的信息,并根据PHP-5.2.2修正和添加了一些信息]
;=============================================
;;==========配置指令详解===========================
;=============================================
; 以下每个指令的设定值都与 PHP-5.2.2 内建的默认值相同。
; 也就是说,如果'php.ini'不存在,或者你删掉了某些行,默认值与之相同。

;;;;;;;;;;;;;;
;; Apache ;;

[Apache]
; 仅在将PHP作为Apache模块时才有效。

child_terminate = Off
; PHP脚本在请求结束后是否允许使用apache_child_terminate()函数终止子进程。
; 该指令仅在UNIX平台上将PHP安装为Apache1.3的模块时可用。其他情况下皆不存在。

engine = On
; 是否启用PHP解析引擎。
; 提示:可以在httpd.conf中基于目录或者虚拟主机来打开或者关闭PHP解析引擎。

last_modified = Off
; 是否在Last-Modified应答头中放置该PHP脚本的最后修改时间。

xbithack = Off
; 是否不管文件结尾是什么,都作为PHP可执行位组来解析。



;; PHP核心 ;;


[PHP-Core-DateTime]
; 前四个配置选项目前仅用于date_sunrise()和date_sunset()函数。

date.default_latitude = 31.7667
; 默认纬度

date.default_longitude = 35.2333
; 默认经度

date.sunrise_zenith = 90.583333
; 默认日出天顶

date.sunset_zenith = 90.583333
; 默认日落天顶

date.timezone =
; 未设定TZ环境变量时用于所有日期和时间函数的默认时区。
; 中国大陆应当使用"PRC"
; 应用时区的优先顺序为:
; 1. 用date_default_timezone_set()函数设定的时区(如果设定了的话)
; 2. TZ 环境变量(如果非空的话)
; 3. 该指令的值(如果设定了的话)
; 4. PHP自己推测(如果操作系统支持)
; 5. 如果以上都不成功,则使用 UTC


[PHP-Core-Assert]

assert.active = On
; 是否启用assert()断言评估

assert.bail = Off
; 是否在发生失败断言时中止脚本的执行

assert.callback =
; 发生失败断言时执行的回调函数

assert.quiet_eval = Off
; 是否使用安静评估(不显示任何错误信息,相当于error_reporting=0)。
; 若关闭则在评估断言表达式的时候使用当前的error_reporting指令值。

assert.warning = On
; 是否对每个失败断言都发出警告


[PHP-Core-SafeMode]
; 安全模式是为了解决共享服务器的安全问题而设立的。
; 但试图在PHP层解决这个问题在结构上是不合理的,
; 正确的做法应当是修改web服务器层和操作系统层。
; 因此在PHP6中废除了安全模式,并使用基于open_basedir的安全防护。
; 此部分指令在PHP6中已经全部被删除。

safe_mode = Off
;SYS
; 是否启用安全模式。
; 打开时,PHP将检查当前脚本的拥有者是否和被操作的文件的拥有者相同,
; 相同则允许操作,不同则拒绝操作。

safe_mode_gid = Off
;SYS
; 在安全模式下,默认在访问文件时会做UID比较检查。
; 但有些情况下严格的UID检查反而是不适合的,宽松的GID检查已经足够。
; 如果你想将其放宽到仅做GID比较,可以打开这个参数。

safe_mode_allowed_env_vars = "PHP_"
;SYS
; 在安全模式下,用户仅可以更改的环境变量的前缀列表(逗号分隔)。
; 允许用户设置某些环境变量,可能会导致潜在的安全漏洞。
; 注意: 如果这一参数值为空,PHP将允许用户更改任意环境变量!

safe_mode_protected_env_vars = "LD_LIBRARY_PATH"
;SYS
; 在安全模式下,用户不能更改的环境变量列表(逗号分隔)。
; 这些变量即使在safe_mode_allowed_env_vars指令设置为允许的情况下也会得到保护。

safe_mode_exec_dir = "/usr/local/php/bin"
;SYS
; 在安全模式下,只有该目录下的可执行程序才允许被执行系统程序的函数执行。
; 这些函数是:system, escapeshellarg, escapeshellcmd, exec, passthru,
; proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec

safe_mode_include_dir =
;SYS
; 在安全模式下,该组目录和其子目录下的文件被包含时,将跳过UID/GID检查。
; 换句话说,如果此处的值为空,任何UID/GID不符合的文件都不允许被包含。
; 这里设置的目录必须已经存在于include_path指令中或者用完整路径来包含。
; 多个目录之间用冒号(Win下为分号)隔开。
; 指定的限制实际上是一个前缀,而非一个目录名,
; 也就是说"/dir/incl"将允许访问"/dir/include"和"/dir/incls"
; 如果您希望将访问控制在一个指定的目录,那么请在结尾加上斜线。


[PHP-Core-Safe]

allow_url_fopen = On
;SYS
; 是否允许打开远程文件

allow_url_include = Off
;SYS
; 是否允许include/require远程文件。

disable_classes =
;SYS
; 该指令接受一个用逗号分隔的类名列表,以禁用特定的类。

disable_functions =
;SYS
; 该指令接受一个用逗号分隔的函数名列表,以禁用特定的函数。

enable_dl = On
;SYS
; 是否允许使用dl()函数。dl()函数仅在将PHP作为apache模块安装时才有效。
; 禁用dl()函数主要是出于安全考虑,因为它可以绕过open_basedir指令的限制。
; 在安全模式下始终禁用dl()函数,而不管此处如何设置。
; PHP6中删除了该指令,相当于设为Off。

expose_php = On
;SYS
; 是否暴露PHP被安装在服务器上的事实(在http头中加上其签名)。
; 它不会有安全上的直接威胁,但它使得客户端知道服务器上安装了PHP。

open_basedir =
;SYS
; 将PHP允许操作的所有文件(包括文件自身)都限制在此组目录列表下。
; 当一个脚本试图打开一个指定目录树之外的文件时,将遭到拒绝。
; 所有的符号连接都会被解析,所以不可能通过符号连接来避开此限制。
; 特殊值'.'指定了存放该脚本的目录将被当做基准目录。
; 但这有些危险,因为脚本的工作目录可以轻易被chdir()改变。
; 对于共享服务器,在httpd.conf中灵活设置该指令将变得非常有用。
; 在Windows中用分号分隔目录,UNIX系统中用冒号分隔目录。
; 作为Apache模块时,父目录中的open_basedir路径将自动被继承。
; 指定的限制实际上是一个前缀,而非一个目录名,
; 也就是说"/dir/incl"将允许访问"/dir/include"和"/dir/incls",
; 如果您希望将访问控制在一个指定的目录,那么请在结尾加上一个斜线。
; 默认是允许打开所有文件。

sql.safe_mode = Off
;SYS
; 是否使用SQL安全模式。
; 如果打开,指定默认值的数据库连接函数将会使用这些默认值代替支持的参数。
; 对于每个不同数据库的连接函数,其默认值请参考相应的手册页面。


[PHP-Core-Error]

error_reporting = E_ALL & ~E_NOTICE
; 错误报告级别是位字段的叠加,推荐使用 E_ALL | E_STRICT
; 1 E_ERROR 致命的运行时错误
; 2 E_WARNING 运行时警告(非致命性错误)
; 4 E_PARSE 编译时解析错误
; 8 E_NOTICE 运行时提醒(经常是bug,也可能是有意的)
; 16 E_CORE_ERROR PHP启动时初始化过程中的致命错误
; 32 E_CORE_WARNING PHP启动时初始化过程中的警告(非致命性错)
; 64 E_COMPILE_ERROR 编译时致命性错
; 128 E_COMPILE_WARNING 编译时警告(非致命性错)
; 256 E_USER_ERROR 用户自定义的致命错误
; 512 E_USER_WARNING 用户自定义的警告(非致命性错误)
; 1024 E_USER_NOTICE 用户自定义的提醒(经常是bug,也可能是有意的)
; 2048 E_STRICT 编码标准化警告(建议如何修改以向前兼容)
; 4096 E_RECOVERABLE_ERROR 接近致命的运行时错误,若未被捕获则视同E_ERROR
; 6143 E_ALL 除E_STRICT外的所有错误(PHP6中为8191,即包含所有)

track_errors = Off
; 是否在变量$php_errormsg中保存最近一个错误或警告消息。

display_errors = On
; 是否将错误信息作为输出的一部分显示。
; 在最终发布的web站点上,强烈建议你关掉这个特性,并使用错误日志代替(参看下面)。
; 在最终发布的web站点打开这个特性可能暴露一些安全信息,
; 例如你的web服务上的文件路径、数据库规划或别的信息。

display_startup_errors = Off
; 是否显示PHP启动时的错误。
; 即使display_errors指令被打开,关闭此参数也将不显示PHP启动时的错误。
; 建议你关掉这个特性,除非你必须要用于调试中。

report_memleaks = On
; 是否报告内存泄漏。这个参数只在以调试方式编译的PHP中起作用,
; 并且必须在error_reporting指令中包含 E_WARNING

report_zend_debug = On
; 尚无说明文档

html_errors = On
; 是否在出错信息中使用HTML标记。
; 注意: 不要在发布的站点上使用这个特性!

docref_root = ;"http://localhost/phpmanual/"
docref_ext = ;".html"
; 如果打开了html_errors指令,PHP将会在出错信息上显示超连接,
; 直接链接到一个说明这个错误或者导致这个错误的函数的页面。
; 你可以从http://www.php.net/docs.php下载php手册,
; 并将docref_root指令指向你本地的手册所在的URL目录。
; 你还必须设置docref_ext指令来指定文件的扩展名(必须含有'.')。
; 注意: 不要在发布的站点上使用这个特性。

error_prepend_string = ;""
; 用于错误信息前输出的字符串
error_append_string = ;"
"
; 用于错误信息后输出的字符串

xmlrpc_errors = Off
;SYS
xmlrpc_error_number = 0
; 尚无文档


[PHP-Core-Logging]

define_syslog_variables = Off
; 是否定义各种系统日志变量,如:$LOG_PID, $LOG_CRON 等等。
; 关掉它以提高效率的好主意。
; 你可以在运行时调用define_syslog_variables()函数来定义这些变量。

error_log =
; 将错误日志记录到哪个文件中。该文件必须对Web服务器用户可写。
; syslog 表示记录到系统日志中(NT下的事件日志, Unix下的syslog(3))
; 如果此处未设置任何值,则错误将被记录到Web服务器的错误日志中。

log_errors = Off
; 是否在日志文件里记录错误,具体在哪里记录取决于error_log指令。
; 强烈建议你在最终发布的web站点时使用日志记录错误而不是直接输出,
; 这样可以让你既知道那里出了问题,又不会暴露敏感信息。

log_errors_max_len = 1024
; 设置错误日志中附加的与错误信息相关联的错误源的最大长度。
; 这里设置的值对显示的和记录的错误以及$php_errormsg都有效。
; 设为 0 可以允许无限长度。

ignore_repeated_errors = Off
; 记录错误日志时是否忽略重复的错误信息。
; 错误信息必须出现在同一文件的同一行才被被视为重复。

ignore_repeated_source = Off
; 是否在忽略重复的错误信息时忽略重复的错误源。

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to turn off cache in php.ini How to turn off cache in php.ini Mar 15, 2021 am 09:35 AM

How to turn off the cache in php.ini: 1. Find and open the php.ini configuration file; 2. Find the "opcache.enable" and "opcache.enable_cli" options and modify them to "opcache.enable=0" and "opcache. enable_cli=0”; 3. Save the modified file.

The difference between win10 English version and Chinese version The difference between win10 English version and Chinese version Jan 04, 2024 pm 12:49 PM

The main difference between the English version and the Chinese version of Win10 lies in the language interface and pre-installed applications. The interface of the English version is in English, and all pre-installed applications are in English; the interface of the Chinese version is in Chinese, and the pre-installed applications are also operated in Chinese. Other than these, the functions and operations of the two versions are actually exactly the same. The differences between the English version and the Chinese version of win10: 1. Language: In the English version of Windows 10, English will appear as the default language, while in the Chinese version of Windows 10, Chinese is set as the default language. This means that after we complete the installation, users will see that the system interface, menus, dialog boxes, error prompts, etc. are all presented in different languages. 2. Pre-installed applications:

How to modify the php.ini file in wamp How to modify the php.ini file in wamp Mar 20, 2023 pm 03:33 PM

Wampserver is a software package that can install Apache, PHP and MySQL on Windows computers. Develop and test PHP websites on your local computer easily with Wampserver. During the development process, we may need to modify the PHP configuration file php.ini. This article will introduce how to modify the php.ini file in Wampserver.

Let's talk about how to modify the php.ini configuration file Let's talk about how to modify the php.ini configuration file Mar 28, 2023 pm 05:34 PM

PHP.ini is a PHP configuration file that is used to control the performance of PHP on the server. This file is used to set the values ​​of some variables to control PHP at runtime. This article will show you how to modify the PHP.ini configuration file to control how PHP behaves on your server.

What are the similarities and differences between Windows 10 Home Edition and Home Chinese Edition? What are the similarities and differences between Windows 10 Home Edition and Home Chinese Edition? Dec 27, 2023 pm 03:29 PM

We know that there are many different versions of the win10 system. Because they target different users, the main functions of the different versions are also different. In addition to the well-known home version, flagship version, professional version, etc., there are also many versions that we are not familiar with. Today, the editor will talk to you about the differences between Windows 10 Home Edition and Home Chinese Edition. Let’s learn more about the details~ I hope it can help you. What is the difference between Windows 10 Home Edition and Home Chinese Edition? The default system language is different 1. Windows 10 Home Edition: The default system language of Windows 10 Home Edition is English. 2. Windows 10 Home Chinese Edition: The default system language of Windows 10 Home Chinese Edition is Simplified Chinese.

[Compilation and Summary] Common PHP.ini prompt errors and solutions [Compilation and Summary] Common PHP.ini prompt errors and solutions Mar 20, 2023 pm 04:56 PM

PHP is a commonly used server-side scripting language that is widely used in the field of web development. However, during the PHP development process, we often encounter various problems. Among them, PHP.ini prompt error is a common problem.

How to change time zone in php.ini file How to change time zone in php.ini file Mar 22, 2023 pm 03:22 PM

PHP is a very popular server-side programming language. When developing web applications using PHP, we sometimes need to set the time zone in PHP. The default time zone of PHP is "UTC (Coordinated Universal Time)", which is not the time zone we want in many cases, so we need to change the time zone setting in the php.ini file. This article will explain how to change the time zone in the php.ini file.

How to convert the Chinese version of WIN10 Home Edition to the English version? How to convert the Chinese version of WIN10 Home Edition to the English version? Jan 16, 2024 pm 12:33 PM

There are many friends who want to change their computers to English, but don’t know how to do it. We only need to find the search option on the start interface, and then we can find the language settings. Just change it to English. It is very simple and convenient. How to change the Chinese version of win10 home version to the English version: 1. Please right-click the "Start" icon in the lower left corner, and then select the "Search" option in the pop-up dialog box. 2. In the search field that opens, enter "language". Then in the best match item, select "Language Settings". 3. In the language setting interface, just change the Windows display language to "English". 4. Next, we can select "Add Language" in the option box in the preferred language. 5. In the pop-up

See all articles