php配置文件语法

2013年12月11日 09:21:58

 

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

php.ini 的语法非常简单,空白和以分号开头的行都会被忽略掉(估计你也这样想),段落标识符也会被忽略,即便这个标识符表达了某种意思

根据上面的说法:

1.(指令)段落的标识符写的时候可以不注意大小写([Xdebuge],[xdebuge])

2.配置命令可以写在配置文件的任何地方

 

; Directives following the section heading [PATH=/www/mysite] only
; apply to PHP files in the /www/mysite directory.  Directives
; following the section heading [HOST=www.example.com] only apply to
; PHP files served from www.example.com.  Directives set in these
; special sections cannot be overridden by user-defined INI files or
; at runtime. Currently, [PATH=] and [HOST=] sections only work under
; CGI/FastCGI.

有两个段落标识符很特殊,特殊在只能在cgi/fastcgi下起作用:
[PATH=....]

[HOST=....]

path段里的指令集只适用于指定的路径的php脚本文件

host段里的指令集只使用于指定的域名下的php脚本文件

注:Apache可以选择PHP是否工作在fastcgi模式下,nginx下的PHP只能在fastcgi模式下工作

 

; Directive names are *case sensitive* - foo=bar is different from FOO=bar.

指令的name区分大小写

 

; 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), a quoted string ("bar"), or a reference to a
; previously set variable or directive (e.g. ${foo})

指令的value可以是:
字符串,数字,双引号包围的字符串

PHP常量,INI常量

表达式,引用已经定义过的变量或指令

 

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

布尔类型的变量

On, True, Yes 会被转化成1;
Off, False, No 会被转化为0;

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值