另外的一个总结:php.ini的加载逻辑: ; PHP attempts to find and load this configuration from a number of locations. ; The following is a summary of its search order: ; 1. SAPI module specific location. ; 2. The PHPRC environment variable. (As of PHP 5.2.0) ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) ; 4. Current working directory (except CLI) ; 5. The web server's directory (for SAPI modules), or directory of PHP ; (otherwise in Windows) ; 6. The directory from the --with-config-file-path compile time option, or the ; Windows directory (C:\windows or C:\winnt) 由上可知,php会 1. 首先从sapi的参数中查看是否指定了php.ini 2. 如果没有就通过PHPRC环境变量指定的路径查找 3. 如果没有,或者PHPRC环境变量未设置,则从registry keys注册表从找(专用于windows) 4. 从当前的工作目录中查找(除了CLI) 5. 从web服务器的目录中查找(对于SAPI模块),或者PHP的目录中 6. 从php编译时指定的--with-config-file-path中查找,或者在windows directory(C:\windows or C:\winnt)
output_buffering
; Output buffering is a mechanism for controlling how much output data ; (excluding headers and cookies) PHP should keep internally before pushing that ; data to the client. If your application's output exceeds this setting, PHP ; will send that data in chunks of roughly the size you specify. ; Turning on this setting and managing its maximum buffer size can yield some ; interesting side-effects depending on your application and web server. ; You may be able to send headers and cookies after you've already sent output ; through print or echo. You also may see performance benefits if your server is ; emitting less packets due to buffered output versus PHP streaming the output ; as it gets it. On production servers, 4096 bytes is a good setting for performance ; reasons. ; Note: Output buffering can also be controlled via Output Buffering Control functions. 由上可知,本条指令控制是否打开输出缓存。 注意,当打开输出缓存时,header()、session_start()等于response header有关的函数,可能可以在输出之后调用。当关闭本指令时,因为响应头是向发出的,所以在这些函数之前,不能存在输出。
?
posted on
2017-07-04 17:45jade640
阅读(149)
评论(0)
收藏举报