• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

php配置文件语法

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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人参与评论

请发表评论

全部评论

专题导读
上一篇:
配置PHP中配置文件php.ini发布时间:2022-07-10
下一篇:
PHP配置文件www.conf发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap