Linux 下LNMP环境搭建_【all】

LNMP = Linux + Nginx + Mysql + PHP

1.0 Linux环境搭建

Linux 系统安装【Redhat】

1.1. FastCGI介绍

1.什么是CGI(common gateway interface)
    -->通用网关接口,用于Http服务和其他机器上程序服务交流的工具
    -->CGI必须运行在网络服务器上
2.什么是FastCGI
    FastCGi是一个可伸缩地,高速地在HTTP服务器和动态脚本语言直接通信的接口(FastCGI在Linux下的socket,可以是文件socket,也可以是ip socket)
   原理:FastCGIS模式,可以将HTTP请求和解析服务器分开,同时在脚本解析服务器上启动一个或者多个脚本解析守护进程。当HTTP服务器每次遇到动态程序的时候,可以直接发送给FastCGI进程执行,然后将得到的结果返回给浏览器,这种方式可以让HTTP服务器专一地处理静态请求或者将动态脚本服务器的结果返回给客户端,提供应用整体的性能
    优点:动态语言和HTTP服务器分离开,Apache,Nginx支持这个
          是CS架构,可以提高应用的性能
          php动态语言服务器端可以启动多个FastCGI的守护进程
          http服务器通过(Nginx fastcgi_pass)FastCGI客户端和动态语言FastCGI服务端通信(php-fpm)
3.FastCGI的运行原理
    Nginx不支持外部动态程序的直接调用或者解析,所有的外部程序都必须通过FastCGI接口调用
    FastCGI在linux下是是一个socket,可以是文件socket,也可以是ipsocket
    为了调用服务器端CGI程序,还需有一个FastCGI的wrapper(相当于启动另一个程序),绑定在固定的socket上,当Nginx将CGI请求发送给这个socket(通过FastCGI接口调用wrapper请求,然后派生出来一个新的线程,这个线程调用php解析器解析文件,并返回结果给wrapper,接着wrapper将返回的数据通过FastCGI沿着socket传递给Nginx,然后Nginx返回给客户端显示

image

Nginx安装

企业级Nginx详解

Mysql安装

【更多参考】

Linu下的Mysql学习详解  https://www.cnblogs.com/ftl1012/p/9296238.html

PHP环境搭建

1. yum源安装【不推荐】

 yum install php

 注意:不推荐,因为安装后的文件比较散

2. 源码安装(本文以5.3为版本)

##获取php安装包【可以去官网下载最新版本】

##PHP7.X 取消了对mysql的扩展支撑,笔者20181010亲测后期安装discuz等软件会有问题

快速获取文件[php5.3.27]:链接:https://pan.baidu.com/s/1XgjsXVOTQPu5WtweIlLQ6A  密码:v1oi

cd /opt/tools
wget http://us1.php.net/distributions/php-5.3.27.tar.bz2
tar jxf php-5.3.27.tar.bz2

##检查安装php所需lib库

rpm -qa zlib-devel libxml2-devel libjpeg-turbo-devel libiconv-devel
rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel


##安装所需的lib包
##安装libxslt-devel前必须安装libgcrypt-devel
##libiconv-devel没有的哦

yum install -y libgcrypt-devel    -->(阿里云的yum配置)    
yum install -y libxslt-devel      -->(expl也可以)
yum install zlib-devel libxml2-devel libjpeg-turbo libiconv-devel -y 
yum install freetype-devel libpng-devel gd-devel libcurl-devel –y
##安装libiconv-1.15.tar.gz
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
可选:yum install gcc
tar xf libiconv-1.15.tar.gz 
cd libiconv-1.15
 ./configure --prefix=/usr/local/libiconv;make;make install

##快速安装mhash -->使用epel源

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum install mhash mhash-devel -y
rpm -qa mhash mhash-devel

##安装mcrypt库
配置epel源后可以直接yum安装

yum install mcrypt
rpm -qa mcrypt

##安装libmcrypt-devel

yum install libmcrypt-devel -y 
##安装openssl
yum install openssl openssl-devel -y
rpm -qa | grep openssl

## 设置mysql

cat /etc/ld.so.conf | grep mysql                      # 查看是否有mysql信息
echo "/usr/local/mysql/lib" >>/etc/ld.so.conf  # 写入文件
ldconfig                                                         #重启

 

##安装php

cd /opt/tools
less INSTALL # 查看安装帮助
touch ext/phar/phar.php # 不创建该文件,后面安装会报错
chmod 755 ext/phar/phar.php ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local/libiconv/ --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags --enable-zend-multibyte --enable-static --with-xsl --with-fpm-user=nginx --with-fpm-group=nginx --enable-ftp make; make install

##配置PHP的解析文件 -->php.ini

[root@lnmp01 php]#cd /opt/tools/php-5.3.27
[root@lnmp01 php]# ll php.ini-*
-rw-r--r--. 1 101 101 69606 Jul 11  2013 php.ini-development  -->开发环境
-rw-r--r--. 1 101 101 69627 Jul 11  2013 php.ini-production   -->生产环境
二者的区别就是关于调试Error的开关是否开启

 

复制文件到php安装目录的默认配合lib下

cp /opt/tools/php-5.3.27/php.ini-production /usr/local/php/lib/php.ini  
   1 [PHP]
   2 
   3 ;;;;;;;;;;;;;;;;;;;
   4 ; About php.ini   ;
   5 ;;;;;;;;;;;;;;;;;;;
   6 ; PHP's initialization file, generally called php.ini, is responsible for
   7 ; configuring many of the aspects of PHP's behavior.
   8 
   9 ; PHP attempts to find and load this configuration from a number of locations.
  10 ; The following is a summary of its search order:
  11 ; 1. SAPI module specific location.
  12 ; 2. The PHPRC environment variable. (As of PHP 5.2.0)
  13 ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)
  14 ; 4. Current working directory (except CLI)
  15 ; 5. The web server's directory (for SAPI modules), or directory of PHP
  16 ; (otherwise in Windows)
  17 ; 6. The directory from the --with-config-file-path compile time option, or the
  18 ; Windows directory (C:\windows or C:\winnt)
  19 ; See the PHP docs for more specific information.
  20 ; http://php.net/configuration.file
  21 
  22 ; The syntax of the file is extremely simple.  Whitespace and lines
  23 ; beginning with a semicolon are silently ignored (as you probably guessed).
  24 ; Section headers (e.g. [Foo]) are also silently ignored, even though
  25 ; they might mean something in the future.
  26 
  27 ; Directives following the section heading [PATH=/www/mysite] only
  28 ; apply to PHP files in the /www/mysite directory.  Directives
  29 ; following the section heading [HOST=www.example.com] only apply to
  30 ; PHP files served from www.example.com.  Directives set in these
  31 ; special sections cannot be overridden by user-defined INI files or
  32 ; at runtime. Currently, [PATH=] and [HOST=] sections only work under
  33 ; CGI/FastCGI.
  34 ; http://php.net/ini.sections
  35 
  36 ; Directives are specified using the following syntax:
  37 ; directive = value
  38 ; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
  39 ; Directives are variables used to configure PHP or PHP extensions.
  40 ; There is no name validation.  If PHP can't find an expected
  41 ; directive because it is not set or is mistyped, a default value will be used.
  42 
  43 ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
  44 ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
  45 ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a
  46 ; previously set variable or directive (e.g. ${foo})
  47 
  48 ; Expressions in the INI file are limited to bitwise operators and parentheses:
  49 ; |  bitwise OR
  50 ; ^  bitwise XOR
  51 ; &  bitwise AND
  52 ; ~  bitwise NOT
  53 ; !  boolean NOT
  54 
  55 ; Boolean flags can be turned on using the values 1, On, True or Yes.
  56 ; They can be turned off using the values 0, Off, False or No.
  57 
  58 ; An empty string can be denoted by simply not writing anything after the equal
  59 ; sign, or by using the None keyword:
  60 
  61 ;  foo =         ; sets foo to an empty string
  62 ;  foo = None    ; sets foo to an empty string
  63 ;  foo = "None"  ; sets foo to the string 'None'
  64 
  65 ; If you use constants in your value, and these constants belong to a
  66 ; dynamically loaded extension (either a PHP extension or a Zend extension),
  67 ; you may only use these constants *after* the line that loads the extension.
  68 
  69 ;;;;;;;;;;;;;;;;;;;
  70 ; About this file ;
  71 ;;;;;;;;;;;;;;;;;;;
  72 ; PHP comes packaged with two INI files. One that is recommended to be used
  73 ; in production environments and one that is recommended to be used in
  74 ; development environments.
  75 
  76 ; php.ini-production contains settings which hold security, performance and
  77 ; best practices at its core. But please be aware, these settings may break
  78 ; compatibility with older or less security conscience applications. We
  79 ; recommending using the production ini in production and testing environments.
  80 
  81 ; php.ini-development is very similar to its production variant, except it's
  82 ; much more verbose when it comes to errors. We recommending using the
  83 ; development version only in development environments as errors shown to
  84 ; application users can inadvertently leak otherwise secure information.
  85 
  86 ;;;;;;;;;;;;;;;;;;;
  87 ; Quick Reference ;
  88 ;;;;;;;;;;;;;;;;;;;
  89 ; The following are all the settings which are different in either the production
  90 ; or development versions of the INIs with respect to PHP's default behavior.
  91 ; Please see the actual settings later in the document for more details as to why
  92 ; we recommend these changes in PHP's behavior.
  93 
  94 ; allow_call_time_pass_reference
  95 ;   Default Value: On
  96 ;   Development Value: Off
  97 ;   Production Value: Off
  98 
  99 ; display_errors
 100 ;   Default Value: On
 101 ;   Development Value: On
 102 ;   Production Value: Off
 103 
 104 ; display_startup_errors
 105 ;   Default Value: Off
 106 ;   Development Value: On
 107 ;   Production Value: Off
 108 
 109 ; error_reporting
 110 ;   Default Value: E_ALL & ~E_NOTICE
 111 ;   Development Value: E_ALL | E_STRICT
 112 ;   Production Value: E_ALL & ~E_DEPRECATED
 113 
 114 ; html_errors
 115 ;   Default Value: On
 116 ;   Development Value: On
 117 ;   Production value: Off
 118 
 119 ; log_errors
 120 ;   Default Value: Off
 121 ;   Development Value: On
 122 ;   Production Value: On
 123 
 124 ; magic_quotes_gpc
 125 ;   Default Value: On
 126 ;   Development Value: Off
 127 ;   Production Value: Off
 128 
 129 ; max_input_time
 130 ;   Default Value: -1 (Unlimited)
 131 ;   Development Value: 60 (60 seconds)
 132 ;   Production Value: 60 (60 seconds)
 133 
 134 ; output_buffering
 135 ;   Default Value: Off
 136 ;   Development Value: 4096
 137 ;   Production Value: 4096
 138 
 139 ; register_argc_argv
 140 ;   Default Value: On
 141 ;   Development Value: Off
 142 ;   Production Value: Off
 143 
 144 ; register_long_arrays
 145 ;   Default Value: On
 146 ;   Development Value: Off
 147 ;   Production Value: Off
 148 
 149 ; request_order
 150 ;   Default Value: None
 151 ;   Development Value: "GP"
 152 ;   Production Value: "GP"
 153 
 154 ; session.bug_compat_42
 155 ;   Default Value: On
 156 ;   Development Value: On
 157 ;   Production Value: Off
 158 
 159 ; session.bug_compat_warn
 160 ;   Default Value: On
 161 ;   Development Value: On
 162 ;   Production Value: Off
 163 
 164 ; session.gc_divisor
 165 ;   Default Value: 100
 166 ;   Development Value: 1000
 167 ;   Production Value: 1000
 168 
 169 ; session.hash_bits_per_character
 170 ;   Default Value: 4
 171 ;   Development Value: 5
 172 ;   Production Value: 5
 173 
 174 ; short_open_tag
 175 ;   Default Value: On
 176 ;   Development Value: Off
 177 ;   Production Value: Off
 178 
 179 ; track_errors
 180 ;   Default Value: Off
 181 ;   Development Value: On
 182 ;   Production Value: Off
 183 
 184 ; url_rewriter.tags
 185 ;   Default Value: "a=href,area=href,frame=src,form=,fieldset="
 186 ;   Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
 187 ;   Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
 188 
 189 ; variables_order
 190 ;   Default Value: "EGPCS"
 191 ;   Development Value: "GPCS"
 192 ;   Production Value: "GPCS"
 193 
 194 ;;;;;;;;;;;;;;;;;;;;
 195 ; php.ini Options  ;
 196 ;;;;;;;;;;;;;;;;;;;;
 197 ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
 198 ;user_ini.filename = ".user.ini"
 199 
 200 ; To disable this feature set this option to empty value
 201 ;user_ini.filename =
 202 
 203 ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)
 204 ;user_ini.cache_ttl = 300
 205 
 206 ;;;;;;;;;;;;;;;;;;;;
 207 ; Language Options ;
 208 ;;;;;;;;;;;;;;;;;;;;
 209 
 210 ; Enable the PHP scripting language engine under Apache.
 211 ; http://php.net/engine
 212 engine = On
 213 
 214 ; This directive determines whether or not PHP will recognize code between
 215 ; <? and ?> tags as PHP source which should be processed as such. It's been
 216 ; recommended for several years that you not use the short tag "short cut" and
 217 ; instead to use the full <?php and ?> tag combination. With the wide spread use
 218 ; of XML and use of these tags by other languages, the server can become easily
 219 ; confused and end up parsing the wrong code in the wrong context. But because
 220 ; this short cut has been a feature for such a long time, it's currently still
 221 ; supported for backwards compatibility, but we recommend you don't use them.
 222 ; Default Value: On
 223 ; Development Value: Off
 224 ; Production Value: Off
 225 ; http://php.net/short-open-tag
 226 short_open_tag = Off
 227 
 228 ; Allow ASP-style <% %> tags.
 229 ; http://php.net/asp-tags
 230 asp_tags = Off
 231 
 232 ; The number of significant digits displayed in floating point numbers.
 233 ; http://php.net/precision
 234 precision = 14
 235 
 236 ; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
 237 ; http://php.net/y2k-compliance
 238 y2k_compliance = On
 239 
 240 ; Output buffering is a mechanism for controlling how much output data
 241 ; (excluding headers and cookies) PHP should keep internally before pushing that
 242 ; data to the client. If your application's output exceeds this setting, PHP
 243 ; will send that data in chunks of roughly the size you specify.
 244 ; Turning on this setting and managing its maximum buffer size can yield some
 245 ; interesting side-effects depending on your application and web server.
 246 ; You may be able to send headers and cookies after you've already sent output
 247 ; through print or echo. You also may see performance benefits if your server is
 248 ; emitting less packets due to buffered output versus PHP streaming the output
 249 ; as it gets it. On production servers, 4096 bytes is a good setting for performance
 250 ; reasons.
 251 ; Note: Output buffering can also be controlled via Output Buffering Control
 252 ;   functions.
 253 ; Possible Values:
 254 ;   On = Enabled and buffer is unlimited. (Use with caution)
 255 ;   Off = Disabled
 256 ;   Integer = Enables the buffer and sets its maximum size in bytes.
 257 ; Note: This directive is hardcoded to Off for the CLI SAPI
 258 ; Default Value: Off
 259 ; Development Value: 4096
 260 ; Production Value: 4096
 261 ; http://php.net/output-buffering
 262 output_buffering = 4096
 263 
 264 ; You can redirect all of the output of your scripts to a function.  For
 265 ; example, if you set output_handler to "mb_output_handler", character
 266 ; encoding will be transparently converted to the specified encoding.
 267 ; Setting any output handler automatically turns on output buffering.
 268 ; Note: People who wrote portable scripts should not depend on this ini
 269 ;   directive. Instead, explicitly set the output handler using ob_start().
 270 ;   Using this ini directive may cause problems unless you know what script
 271 ;   is doing.
 272 ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
 273 ;   and you cannot use both "ob_gzhandler" and "zlib.output_compression".
 274 ; Note: output_handler must be empty if this is set 'On' !!!!
 275 ;   Instead you must use zlib.output_handler.
 276 ; http://php.net/output-handler
 277 ;output_handler =
 278 
 279 ; Transparent output compression using the zlib library
 280 ; Valid values for this option are 'off', 'on', or a specific buffer size
 281 ; to be used for compression (default is 4KB)
 282 ; Note: Resulting chunk size may vary due to nature of compression. PHP
 283 ;   outputs chunks that are few hundreds bytes each as a result of
 284 ;   compression. If you prefer a larger chunk size for better
 285 ;   performance, enable output_buffering in addition.
 286 ; Note: You need to use zlib.output_handler instead of the standard
 287 ;   output_handler, or otherwise the output will be corrupted.
 288 ; http://php.net/zlib.output-compression
 289 zlib.output_compression = Off
 290 
 291 ; http://php.net/zlib.output-compression-level
 292 ;zlib.output_compression_level = -1
 293 
 294 ; You cannot specify additional output handlers if zlib.output_compression
 295 ; is activated here. This setting does the same as output_handler but in
 296 ; a different order.
 297 ; http://php.net/zlib.output-handler
 298 ;zlib.output_handler =
 299 
 300 ; Implicit flush tells PHP to tell the output layer to flush itself
 301 ; automatically after every output block.  This is equivalent to calling the
 302 ; PHP function flush() after each and every call to print() or echo() and each
 303 ; and every HTML block.  Turning this option on has serious performance
 304 ; implications and is generally recommended for debugging purposes only.
 305 ; http://php.net/implicit-flush
 306 ; Note: This directive is hardcoded to On for the CLI SAPI
 307 implicit_flush = Off
 308 
 309 ; The unserialize callback function will be called (with the undefined class'
 310 ; name as parameter), if the unserializer finds an undefined class
 311 ; which should be instantiated. A warning appears if the specified function is
 312 ; not defined, or if the function doesn't include/implement the missing class.
 313 ; So only set this entry, if you really want to implement such a
 314 ; callback-function.
 315 unserialize_callback_func =
 316 
 317 ; When floats & doubles are serialized store serialize_precision significant
 318 ; digits after the floating point. The default value ensures that when floats
 319 ; are decoded with unserialize, the data will remain the same.
 320 serialize_precision = 17
 321 
 322 ; This directive allows you to enable and disable warnings which PHP will issue
 323 ; if you pass a value by reference at function call time. Passing values by
 324 ; reference at function call time is a deprecated feature which will be removed
 325 ; from PHP at some point in the near future. The acceptable method for passing a
 326 ; value by reference to a function is by declaring the reference in the functions
 327 ; definition, not at call time. This directive does not disable this feature, it
 328 ; only determines whether PHP will warn you about it or not. These warnings
 329 ; should enabled in development environments only.
 330 ; Default Value: On (Suppress warnings)
 331 ; Development Value: Off (Issue warnings)
 332 ; Production Value: Off (Issue warnings)
 333 ; http://php.net/allow-call-time-pass-reference
 334 allow_call_time_pass_reference = Off
 335 
 336 ; Safe Mode
 337 ; http://php.net/safe-mode
 338 safe_mode = Off
 339 
 340 ; By default, Safe Mode does a UID compare check when
 341 ; opening files. If you want to relax this to a GID compare,
 342 ; then turn on safe_mode_gid.
 343 ; http://php.net/safe-mode-gid
 344 safe_mode_gid = Off
 345 
 346 ; When safe_mode is on, UID/GID checks are bypassed when
 347 ; including files from this directory and its subdirectories.
 348 ; (directory must also be in include_path or full path must
 349 ; be used when including)
 350 ; http://php.net/safe-mode-include-dir
 351 safe_mode_include_dir =
 352 
 353 ; When safe_mode is on, only executables located in the safe_mode_exec_dir
 354 ; will be allowed to be executed via the exec family of functions.
 355 ; http://php.net/safe-mode-exec-dir
 356 safe_mode_exec_dir =
 357 
 358 ; Setting certain environment variables may be a potential security breach.
 359 ; This directive contains a comma-delimited list of prefixes.  In Safe Mode,
 360 ; the user may only alter environment variables whose names begin with the
 361 ; prefixes supplied here.  By default, users will only be able to set
 362 ; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
 363 ; Note:  If this directive is empty, PHP will let the user modify ANY
 364 ;   environment variable!
 365 ; http://php.net/safe-mode-allowed-env-vars
 366 safe_mode_allowed_env_vars = PHP_
 367 
 368 ; This directive contains a comma-delimited list of environment variables that
 369 ; the end user won't be able to change using putenv().  These variables will be
 370 ; protected even if safe_mode_allowed_env_vars is set to allow to change them.
 371 ; http://php.net/safe-mode-protected-env-vars
 372 safe_mode_protected_env_vars = LD_LIBRARY_PATH
 373 
 374 ; open_basedir, if set, limits all file operations to the defined directory
 375 ; and below.  This directive makes most sense if used in a per-directory
 376 ; or per-virtualhost web server configuration file. This directive is
 377 ; *NOT* affected by whether Safe Mode is turned On or Off.
 378 ; http://php.net/open-basedir
 379 ;open_basedir =
 380 
 381 ; This directive allows you to disable certain functions for security reasons.
 382 ; It receives a comma-delimited list of function names. This directive is
 383 ; *NOT* affected by whether Safe Mode is turned On or Off.
 384 ; http://php.net/disable-functions
 385 disable_functions =
 386 
 387 ; This directive allows you to disable certain classes for security reasons.
 388 ; It receives a comma-delimited list of class names. This directive is
 389 ; *NOT* affected by whether Safe Mode is turned On or Off.
 390 ; http://php.net/disable-classes
 391 disable_classes =
 392 
 393 ; Colors for Syntax Highlighting mode.  Anything that's acceptable in
 394 ; <span style="color: ???????"> would work.
 395 ; http://php.net/syntax-highlighting
 396 ;highlight.string  = #DD0000
 397 ;highlight.comment = #FF9900
 398 ;highlight.keyword = #007700
 399 ;highlight.bg      = #FFFFFF
 400 ;highlight.default = #0000BB
 401 ;highlight.html    = #000000
 402 
 403 ; If enabled, the request will be allowed to complete even if the user aborts
 404 ; the request. Consider enabling it if executing long requests, which may end up
 405 ; being interrupted by the user or a browser timing out. PHP's default behavior
 406 ; is to disable this feature.
 407 ; http://php.net/ignore-user-abort
 408 ;ignore_user_abort = On
 409 
 410 ; Determines the size of the realpath cache to be used by PHP. This value should
 411 ; be increased on systems where PHP opens many files to reflect the quantity of
 412 ; the file operations performed.
 413 ; http://php.net/realpath-cache-size
 414 ;realpath_cache_size = 16k
 415 
 416 ; Duration of time, in seconds for which to cache realpath information for a given
 417 ; file or directory. For systems with rarely changing files, consider increasing this
 418 ; value.
 419 ; http://php.net/realpath-cache-ttl
 420 ;realpath_cache_ttl = 120
 421 
 422 ; Enables or disables the circular reference collector.
 423 ; http://php.net/zend.enable-gc
 424 zend.enable_gc = On
 425 
 426 ;;;;;;;;;;;;;;;;;
 427 ; Miscellaneous ;
 428 ;;;;;;;;;;;;;;;;;
 429 
 430 ; Decides whether PHP may expose the fact that it is installed on the server
 431 ; (e.g. by adding its signature to the Web server header).  It is no security
 432 ; threat in any way, but it makes it possible to determine whether you use PHP
 433 ; on your server or not.
 434 ; http://php.net/expose-php
 435 expose_php = On
 436 
 437 ;;;;;;;;;;;;;;;;;;;
 438 ; Resource Limits ;
 439 ;;;;;;;;;;;;;;;;;;;
 440 
 441 ; Maximum execution time of each script, in seconds
 442 ; http://php.net/max-execution-time
 443 ; Note: This directive is hardcoded to 0 for the CLI SAPI
 444 max_execution_time = 300
 445 
 446 ; Maximum amount of time each script may spend parsing request data. It's a good
 447 ; idea to limit this time on productions servers in order to eliminate unexpectedly
 448 ; long running scripts.
 449 ; Note: This directive is hardcoded to -1 for the CLI SAPI
 450 ; Default Value: -1 (Unlimited)
 451 ; Development Value: 60 (60 seconds)
 452 ; Production Value: 60 (60 seconds)
 453 ; http://php.net/max-input-time
 454 
 455 max_input_time = 300
 456 
 457 ; Maximum input variable nesting level
 458 ; http://php.net/max-input-nesting-level
 459 ;max_input_nesting_level = 64
 460 
 461 ; How many GET/POST/COOKIE input variables may be accepted
 462 ; max_input_vars = 1000
 463 
 464 ; Maximum amount of memory a script may consume (128MB)
 465 ; http://php.net/memory-limit
 466 memory_limit = 128M
 467 
 468 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 469 ; Error handling and logging ;
 470 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 471 
 472 ; This directive informs PHP of which errors, warnings and notices you would like
 473 ; it to take action for. The recommended way of setting values for this
 474 ; directive is through the use of the error level constants and bitwise
 475 ; operators. The error level constants are below here for convenience as well as
 476 ; some common settings and their meanings.
 477 ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
 478 ; those related to E_NOTICE and E_STRICT, which together cover best practices and
 479 ; recommended coding standards in PHP. For performance reasons, this is the
 480 ; recommend error reporting setting. Your production server shouldn't be wasting
 481 ; resources complaining about best practices and coding standards. That's what
 482 ; development servers and development settings are for.
 483 ; Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This
 484 ; means it pretty much reports everything which is exactly what you want during
 485 ; development and early testing.
 486 ;
 487 ; Error Level Constants:
 488 ; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
 489 ; E_ERROR           - fatal run-time errors
 490 ; E_RECOVERABLE_ERROR  - almost fatal run-time errors
 491 ; E_WARNING         - run-time warnings (non-fatal errors)
 492 ; E_PARSE           - compile-time parse errors
 493 ; E_NOTICE          - run-time notices (these are warnings which often result
 494 ;                     from a bug in your code, but it's possible that it was
 495 ;                     intentional (e.g., using an uninitialized variable and
 496 ;                     relying on the fact it's automatically initialized to an
 497 ;                     empty string)
 498 ; E_STRICT          - run-time notices, enable to have PHP suggest changes
 499 ;                     to your code which will ensure the best interoperability
 500 ;                     and forward compatibility of your code
 501 ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
 502 ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
 503 ;                     initial startup
 504 ; E_COMPILE_ERROR   - fatal compile-time errors
 505 ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
 506 ; E_USER_ERROR      - user-generated error message
 507 ; E_USER_WARNING    - user-generated warning message
 508 ; E_USER_NOTICE     - user-generated notice message
 509 ; E_DEPRECATED      - warn about code that will not work in future versions
 510 ;                     of PHP
 511 ; E_USER_DEPRECATED - user-generated deprecation warnings
 512 ;
 513 ; Common Values:
 514 ;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
 515 ;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
 516 ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
 517 ;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
 518 ; Default Value: E_ALL & ~E_NOTICE
 519 ; Development Value: E_ALL | E_STRICT
 520 ; Production Value: E_ALL & ~E_DEPRECATED
 521 ; http://php.net/error-reporting
 522 error_reporting = E_ALL & ~E_DEPRECATED
 523 
 524 ; This directive controls whether or not and where PHP will output errors,
 525 ; notices and warnings too. Error output is very useful during development, but
 526 ; it could be very dangerous in production environments. Depending on the code
 527 ; which is triggering the error, sensitive information could potentially leak
 528 ; out of your application such as database usernames and passwords or worse.
 529 ; It's recommended that errors be logged on production servers rather than
 530 ; having the errors sent to STDOUT.
 531 ; Possible Values:
 532 ;   Off = Do not display any errors
 533 ;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
 534 ;   On or stdout = Display errors to STDOUT
 535 ; Default Value: On
 536 ; Development Value: On
 537 ; Production Value: Off
 538 ; http://php.net/display-errors
 539 display_errors = Off
 540 
 541 ; The display of errors which occur during PHP's startup sequence are handled
 542 ; separately from display_errors. PHP's default behavior is to suppress those
 543 ; errors from clients. Turning the display of startup errors on can be useful in
 544 ; debugging configuration problems. But, it's strongly recommended that you
 545 ; leave this setting off on production servers.
 546 ; Default Value: Off
 547 ; Development Value: On
 548 ; Production Value: Off
 549 ; http://php.net/display-startup-errors
 550 display_startup_errors = Off
 551 
 552 ; Besides displaying errors, PHP can also log errors to locations such as a
 553 ; server-specific log, STDERR, or a location specified by the error_log
 554 ; directive found below. While errors should not be displayed on productions
 555 ; servers they should still be monitored and logging is a great way to do that.
 556 ; Default Value: Off
 557 ; Development Value: On
 558 ; Production Value: On
 559 ; http://php.net/log-errors
 560 log_errors = On
 561 
 562 ; Set maximum length of log_errors. In error_log information about the source is
 563 ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
 564 ; http://php.net/log-errors-max-len
 565 log_errors_max_len = 1024
 566 
 567 ; Do not log repeated messages. Repeated errors must occur in same file on same
 568 ; line unless ignore_repeated_source is set true.
 569 ; http://php.net/ignore-repeated-errors
 570 ignore_repeated_errors = Off
 571 
 572 ; Ignore source of message when ignoring repeated messages. When this setting
 573 ; is On you will not log errors with repeated messages from different files or
 574 ; source lines.
 575 ; http://php.net/ignore-repeated-source
 576 ignore_repeated_source = Off
 577 
 578 ; If this parameter is set to Off, then memory leaks will not be shown (on
 579 ; stdout or in the log). This has only effect in a debug compile, and if
 580 ; error reporting includes E_WARNING in the allowed list
 581 ; http://php.net/report-memleaks
 582 report_memleaks = On
 583 
 584 ; This setting is on by default.
 585 ;report_zend_debug = 0
 586 
 587 ; Store the last error/warning message in $php_errormsg (boolean). Setting this value
 588 ; to On can assist in debugging and is appropriate for development servers. It should
 589 ; however be disabled on production servers.
 590 ; Default Value: Off
 591 ; Development Value: On
 592 ; Production Value: Off
 593 ; http://php.net/track-errors
 594 track_errors = Off
 595 
 596 ; Turn off normal error reporting and emit XML-RPC error XML
 597 ; http://php.net/xmlrpc-errors
 598 ;xmlrpc_errors = 0
 599 
 600 ; An XML-RPC faultCode
 601 ;xmlrpc_error_number = 0
 602 
 603 ; When PHP displays or logs an error, it has the capability of inserting html
 604 ; links to documentation related to that error. This directive controls whether
 605 ; those HTML links appear in error messages or not. For performance and security
 606 ; reasons, it's recommended you disable this on production servers.
 607 ; Note: This directive is hardcoded to Off for the CLI SAPI
 608 ; Default Value: On
 609 ; Development Value: On
 610 ; Production value: Off
 611 ; http://php.net/html-errors
 612 html_errors = Off
 613 
 614 ; If html_errors is set On PHP produces clickable error messages that direct
 615 ; to a page describing the error or function causing the error in detail.
 616 ; You can download a copy of the PHP manual from http://php.net/docs
 617 ; and change docref_root to the base URL of your local copy including the
 618 ; leading '/'. You must also specify the file extension being used including
 619 ; the dot. PHP's default behavior is to leave these settings empty.
 620 ; Note: Never use this feature for production boxes.
 621 ; http://php.net/docref-root
 622 ; Examples
 623 ;docref_root = "/phpmanual/"
 624 
 625 ; http://php.net/docref-ext
 626 ;docref_ext = .html
 627 
 628 ; String to output before an error message. PHP's default behavior is to leave
 629 ; this setting blank.
 630 ; http://php.net/error-prepend-string
 631 ; Example:
 632 ;error_prepend_string = "<span style='color: #ff0000'>"
 633 
 634 ; String to output after an error message. PHP's default behavior is to leave
 635 ; this setting blank.
 636 ; http://php.net/error-append-string
 637 ; Example:
 638 ;error_append_string = "</span>"
 639 
 640 ; Log errors to specified file. PHP's default behavior is to leave this value
 641 ; empty.
 642 ; http://php.net/error-log
 643 ; Example:
 644 ;error_log = php_errors.log
 645 ; Log errors to syslog (Event Log on NT, not valid in Windows 95).
 646 ;error_log = syslog
 647 
 648 ;windows.show_crt_warning
 649 ; Default value: 0
 650 ; Development value: 0
 651 ; Production value: 0
 652 
 653 ;;;;;;;;;;;;;;;;;
 654 ; Data Handling ;
 655 ;;;;;;;;;;;;;;;;;
 656 
 657 ; The separator used in PHP generated URLs to separate arguments.
 658 ; PHP's default setting is "&".
 659 ; http://php.net/arg-separator.output
 660 ; Example:
 661 ;arg_separator.output = "&amp;"
 662 
 663 ; List of separator(s) used by PHP to parse input URLs into variables.
 664 ; PHP's default setting is "&".
 665 ; NOTE: Every character in this directive is considered as separator!
 666 ; http://php.net/arg-separator.input
 667 ; Example:
 668 ;arg_separator.input = ";&"
 669 
 670 ; This directive determines which super global arrays are registered when PHP
 671 ; starts up. If the register_globals directive is enabled, it also determines
 672 ; what order variables are populated into the global space. G,P,C,E & S are
 673 ; abbreviations for the following respective super globals: GET, POST, COOKIE,
 674 ; ENV and SERVER. There is a performance penalty paid for the registration of
 675 ; these arrays and because ENV is not as commonly used as the others, ENV is
 676 ; is not recommended on productions servers. You can still get access to
 677 ; the environment variables through getenv() should you need to.
 678 ; Default Value: "EGPCS"
 679 ; Development Value: "GPCS"
 680 ; Production Value: "GPCS";
 681 ; http://php.net/variables-order
 682 variables_order = "GPCS"
 683 
 684 ; This directive determines which super global data (G,P,C,E & S) should
 685 ; be registered into the super global array REQUEST. If so, it also determines
 686 ; the order in which that data is registered. The values for this directive are
 687 ; specified in the same manner as the variables_order directive, EXCEPT one.
 688 ; Leaving this value empty will cause PHP to use the value set in the
 689 ; variables_order directive. It does not mean it will leave the super globals
 690 ; array REQUEST empty.
 691 ; Default Value: None
 692 ; Development Value: "GP"
 693 ; Production Value: "GP"
 694 ; http://php.net/request-order
 695 request_order = "GP"
 696 
 697 ; Whether or not to register the EGPCS variables as global variables.  You may
 698 ; want to turn this off if you don't want to clutter your scripts' global scope
 699 ; with user data.
 700 ; You should do your best to write your scripts so that they do not require
 701 ; register_globals to be on;  Using form variables as globals can easily lead
 702 ; to possible security problems, if the code is not very well thought of.
 703 ; http://php.net/register-globals
 704 register_globals = Off
 705 
 706 ; Determines whether the deprecated long $HTTP_*_VARS type predefined variables
 707 ; are registered by PHP or not. As they are deprecated, we obviously don't
 708 ; recommend you use them. They are on by default for compatibility reasons but
 709 ; they are not recommended on production servers.
 710 ; Default Value: On
 711 ; Development Value: Off
 712 ; Production Value: Off
 713 ; http://php.net/register-long-arrays
 714 register_long_arrays = Off
 715 
 716 ; This directive determines whether PHP registers $argv & $argc each time it
 717 ; runs. $argv contains an array of all the arguments passed to PHP when a script
 718 ; is invoked. $argc contains an integer representing the number of arguments
 719 ; that were passed when the script was invoked. These arrays are extremely
 720 ; useful when running scripts from the command line. When this directive is
 721 ; enabled, registering these variables consumes CPU cycles and memory each time
 722 ; a script is executed. For performance reasons, this feature should be disabled
 723 ; on production servers.
 724 ; Note: This directive is hardcoded to On for the CLI SAPI
 725 ; Default Value: On
 726 ; Development Value: Off
 727 ; Production Value: Off
 728 ; http://php.net/register-argc-argv
 729 register_argc_argv = Off
 730 
 731 ; When enabled, the SERVER and ENV variables are created when they're first
 732 ; used (Just In Time) instead of when the script starts. If these variables
 733 ; are not used within a script, having this directive on will result in a
 734 ; performance gain. The PHP directives register_globals, register_long_arrays,
 735 ; and register_argc_argv must be disabled for this directive to have any affect.
 736 ; http://php.net/auto-globals-jit
 737 auto_globals_jit = On
 738 
 739 ; Maximum size of POST data that PHP will accept.
 740 ; http://php.net/post-max-size
 741 post_max_size = 16M
 742 
 743 ; Magic quotes are a preprocessing feature of PHP where PHP will attempt to
 744 ; escape any character sequences in GET, POST, COOKIE and ENV data which might
 745 ; otherwise corrupt data being placed in resources such as databases before
 746 ; making that data available to you. Because of character encoding issues and
 747 ; non-standard SQL implementations across many databases, it's not currently
 748 ; possible for this feature to be 100% accurate. PHP's default behavior is to
 749 ; enable the feature. We strongly recommend you use the escaping mechanisms
 750 ; designed specifically for the database your using instead of relying on this
 751 ; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is
 752 ; scheduled removed in PHP 5.4.
 753 ; Default Value: On
 754 ; Development Value: Off
 755 ; Production Value: Off
 756 ; http://php.net/magic-quotes-gpc
 757 magic_quotes_gpc = Off
 758 
 759 ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
 760 ; http://php.net/magic-quotes-runtime
 761 magic_quotes_runtime = Off
 762 
 763 ; Use Sybase-style magic quotes (escape ' with '' instead of \').
 764 ; http://php.net/magic-quotes-sybase
 765 magic_quotes_sybase = Off
 766 
 767 ; Automatically add files before PHP document.
 768 ; http://php.net/auto-prepend-file
 769 auto_prepend_file =
 770 
 771 ; Automatically add files after PHP document.
 772 ; http://php.net/auto-append-file
 773 auto_append_file =
 774 
 775 ; By default, PHP will output a character encoding using
 776 ; the Content-type: header.  To disable sending of the charset, simply
 777 ; set it to be empty.
 778 ;
 779 ; PHP's built-in default is text/html
 780 ; http://php.net/default-mimetype
 781 default_mimetype = "text/html"
 782 
 783 ; PHP's default character set is set to empty.
 784 ; http://php.net/default-charset
 785 ;default_charset = "iso-8859-1"
 786 
 787 ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
 788 ; to disable this feature.
 789 ; http://php.net/always-populate-raw-post-data
 790 ;always_populate_raw_post_data = On
 791 
 792 ;;;;;;;;;;;;;;;;;;;;;;;;;
 793 ; Paths and Directories ;
 794 ;;;;;;;;;;;;;;;;;;;;;;;;;
 795 
 796 ; UNIX: "/path1:/path2"
 797 ;include_path = ".:/php/includes"
 798 ;
 799 ; Windows: "\path1;\path2"
 800 ;include_path = ".;c:\php\includes"
 801 ;
 802 ; PHP's default setting for include_path is ".;/path/to/php/pear"
 803 ; http://php.net/include-path
 804 
 805 ; The root of the PHP pages, used only if nonempty.
 806 ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
 807 ; if you are running php as a CGI under any web server (other than IIS)
 808 ; see documentation for security issues.  The alternate is to use the
 809 ; cgi.force_redirect configuration below
 810 ; http://php.net/doc-root
 811 doc_root =
 812 
 813 ; The directory under which PHP opens the script using /~username used only
 814 ; if nonempty.
 815 ; http://php.net/user-dir
 816 user_dir =
 817 
 818 ; Directory in which the loadable extensions (modules) reside.
 819 ; http://php.net/extension-dir
 820 ; extension_dir = "./"
 821 ; On windows:
 822 ; extension_dir = "ext"
 823 
 824 ; Whether or not to enable the dl() function.  The dl() function does NOT work
 825 ; properly in multithreaded servers, such as IIS or Zeus, and is automatically
 826 ; disabled on them.
 827 ; http://php.net/enable-dl
 828 enable_dl = Off
 829 
 830 ; cgi.force_redirect is necessary to provide security running PHP as a CGI under
 831 ; most web servers.  Left undefined, PHP turns this on by default.  You can
 832 ; turn it off here AT YOUR OWN RISK
 833 ; **You CAN safely turn this off for IIS, in fact, you MUST.**
 834 ; http://php.net/cgi.force-redirect
 835 ;cgi.force_redirect = 1
 836 
 837 ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
 838 ; every request. PHP's default behavior is to disable this feature.
 839 ;cgi.nph = 1
 840 
 841 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
 842 ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
 843 ; will look for to know it is OK to continue execution.  Setting this variable MAY
 844 ; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
 845 ; http://php.net/cgi.redirect-status-env
 846 ;cgi.redirect_status_env =
 847 
 848 ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
 849 ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
 850 ; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting
 851 ; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A setting
 852 ; of zero causes PHP to behave as before.  Default is 1.  You should fix your scripts
 853 ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
 854 ; http://php.net/cgi.fix-pathinfo
 855 ;cgi.fix_pathinfo=1
 856 
 857 ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
 858 ; security tokens of the calling client.  This allows IIS to define the
 859 ; security context that the request runs under.  mod_fastcgi under Apache
 860 ; does not currently support this feature (03/17/2002)
 861 ; Set to 1 if running under IIS.  Default is zero.
 862 ; http://php.net/fastcgi.impersonate
 863 ;fastcgi.impersonate = 1
 864 
 865 ; Disable logging through FastCGI connection. PHP's default behavior is to enable
 866 ; this feature.
 867 ;fastcgi.logging = 0
 868 
 869 ; cgi.rfc2616_headers configuration option tells PHP what type of headers to
 870 ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
 871 ; is supported by Apache. When this option is set to 1 PHP will send
 872 ; RFC2616 compliant header.
 873 ; Default is zero.
 874 ; http://php.net/cgi.rfc2616-headers
 875 ;cgi.rfc2616_headers = 0
 876 
 877 ;;;;;;;;;;;;;;;;
 878 ; File Uploads ;
 879 ;;;;;;;;;;;;;;;;
 880 
 881 ; Whether to allow HTTP file uploads.
 882 ; http://php.net/file-uploads
 883 file_uploads = On
 884 
 885 ; Temporary directory for HTTP uploaded files (will use system default if not
 886 ; specified).
 887 ; http://php.net/upload-tmp-dir
 888 ;upload_tmp_dir =
 889 
 890 ; Maximum allowed size for uploaded files.
 891 ; http://php.net/upload-max-filesize
 892 upload_max_filesize = 2M
 893 
 894 ; Maximum number of files that can be uploaded via a single request
 895 max_file_uploads = 20
 896 
 897 ;;;;;;;;;;;;;;;;;;
 898 ; Fopen wrappers ;
 899 ;;;;;;;;;;;;;;;;;;
 900 
 901 ; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
 902 ; http://php.net/allow-url-fopen
 903 allow_url_fopen = On
 904 
 905 ; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
 906 ; http://php.net/allow-url-include
 907 allow_url_include = Off
 908 
 909 ; Define the anonymous ftp password (your email address). PHP's default setting
 910 ; for this is empty.
 911 ; http://php.net/from
 912 ;from="john@doe.com"
 913 
 914 ; Define the User-Agent string. PHP's default setting for this is empty.
 915 ; http://php.net/user-agent
 916 ;user_agent="PHP"
 917 
 918 ; Default timeout for socket based streams (seconds)
 919 ; http://php.net/default-socket-timeout
 920 default_socket_timeout = 60
 921 
 922 ; If your scripts have to deal with files from Macintosh systems,
 923 ; or you are running on a Mac and need to deal with files from
 924 ; unix or win32 systems, setting this flag will cause PHP to
 925 ; automatically detect the EOL character in those files so that
 926 ; fgets() and file() will work regardless of the source of the file.
 927 ; http://php.net/auto-detect-line-endings
 928 ;auto_detect_line_endings = Off
 929 
 930 ;;;;;;;;;;;;;;;;;;;;;;
 931 ; Dynamic Extensions ;
 932 ;;;;;;;;;;;;;;;;;;;;;;
 933 
 934 ; If you wish to have an extension loaded automatically, use the following
 935 ; syntax:
 936 ;
 937 ;   extension=modulename.extension
 938 ;
 939 ; For example, on Windows:
 940 ;
 941 ;   extension=msql.dll
 942 ;
 943 ; ... or under UNIX:
 944 ;
 945 ;   extension=msql.so
 946 ;
 947 ; ... or with a path:
 948 ;
 949 ;   extension=/path/to/extension/msql.so
 950 ;
 951 ; If you only provide the name of the extension, PHP will look for it in its
 952 ; default extension directory.
 953 ;
 954 ; Windows Extensions
 955 ; Note that ODBC support is built in, so no dll is needed for it.
 956 ; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
 957 ; extension folders as well as the separate PECL DLL download (PHP 5).
 958 ; Be sure to appropriately set the extension_dir directive.
 959 ;
 960 ;extension=php_bz2.dll
 961 ;extension=php_curl.dll
 962 ;extension=php_fileinfo.dll
 963 ;extension=php_gd2.dll
 964 ;extension=php_gettext.dll
 965 ;extension=php_gmp.dll
 966 ;extension=php_intl.dll
 967 ;extension=php_imap.dll
 968 ;extension=php_interbase.dll
 969 ;extension=php_ldap.dll
 970 ;extension=php_mbstring.dll
 971 ;extension=php_exif.dll      ; Must be after mbstring as it depends on it
 972 ;extension=php_mysql.dll
 973 ;extension=php_mysqli.dll
 974 ;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
 975 ;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
 976 ;extension=php_openssl.dll
 977 ;extension=php_pdo_firebird.dll
 978 ;extension=php_pdo_mssql.dll
 979 ;extension=php_pdo_mysql.dll
 980 ;extension=php_pdo_oci.dll
 981 ;extension=php_pdo_odbc.dll
 982 ;extension=php_pdo_pgsql.dll
 983 ;extension=php_pdo_sqlite.dll
 984 ;extension=php_pgsql.dll
 985 ;extension=php_pspell.dll
 986 ;extension=php_shmop.dll
 987 
 988 ; The MIBS data available in the PHP distribution must be installed. 
 989 ; See http://www.php.net/manual/en/snmp.installation.php 
 990 ;extension=php_snmp.dll
 991 
 992 ;extension=php_soap.dll
 993 ;extension=php_sockets.dll
 994 ;extension=php_sqlite.dll
 995 ;extension=php_sqlite3.dll
 996 ;extension=php_sybase_ct.dll
 997 ;extension=php_tidy.dll
 998 ;extension=php_xmlrpc.dll
 999 ;extension=php_xsl.dll
1000 ;extension=php_zip.dll
1001 
1002 ;;;;;;;;;;;;;;;;;;;
1003 ; Module Settings ;
1004 ;;;;;;;;;;;;;;;;;;;
1005 
1006 [Date]
1007 ; Defines the default timezone used by the date functions
1008 ; http://php.net/date.timezone
1009 date.timezone =Asia/Shanghai
1010 
1011 ; http://php.net/date.default-latitude
1012 ;date.default_latitude = 31.7667
1013 
1014 ; http://php.net/date.default-longitude
1015 ;date.default_longitude = 35.2333
1016 
1017 ; http://php.net/date.sunrise-zenith
1018 ;date.sunrise_zenith = 90.583333
1019 
1020 ; http://php.net/date.sunset-zenith
1021 ;date.sunset_zenith = 90.583333
1022 
1023 [filter]
1024 ; http://php.net/filter.default
1025 ;filter.default = unsafe_raw
1026 
1027 ; http://php.net/filter.default-flags
1028 ;filter.default_flags =
1029 
1030 [iconv]
1031 ;iconv.input_encoding = ISO-8859-1
1032 ;iconv.internal_encoding = ISO-8859-1
1033 ;iconv.output_encoding = ISO-8859-1
1034 
1035 [intl]
1036 ;intl.default_locale =
1037 ; This directive allows you to produce PHP errors when some error
1038 ; happens within intl functions. The value is the level of the error produced.
1039 ; Default is 0, which does not produce any errors.
1040 ;intl.error_level = E_WARNING
1041 
1042 [sqlite]
1043 ; http://php.net/sqlite.assoc-case
1044 ;sqlite.assoc_case = 0
1045 
1046 [sqlite3]
1047 ;sqlite3.extension_dir =
1048 
1049 [Pcre]
1050 ;PCRE library backtracking limit.
1051 ; http://php.net/pcre.backtrack-limit
1052 ;pcre.backtrack_limit=100000
1053 
1054 ;PCRE library recursion limit.
1055 ;Please note that if you set this value to a high number you may consume all
1056 ;the available process stack and eventually crash PHP (due to reaching the
1057 ;stack size limit imposed by the Operating System).
1058 ; http://php.net/pcre.recursion-limit
1059 ;pcre.recursion_limit=100000
1060 
1061 [Pdo]
1062 ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
1063 ; http://php.net/pdo-odbc.connection-pooling
1064 ;pdo_odbc.connection_pooling=strict
1065 
1066 ;pdo_odbc.db2_instance_name
1067 
1068 [Pdo_mysql]
1069 ; If mysqlnd is used: Number of cache slots for the internal result set cache
1070 ; http://php.net/pdo_mysql.cache_size
1071 pdo_mysql.cache_size = 2000
1072 
1073 ; Default socket name for local MySQL connects.  If empty, uses the built-in
1074 ; MySQL defaults.
1075 ; http://php.net/pdo_mysql.default-socket
1076 pdo_mysql.default_socket=
1077 
1078 [Phar]
1079 ; http://php.net/phar.readonly
1080 ;phar.readonly = On
1081 
1082 ; http://php.net/phar.require-hash
1083 ;phar.require_hash = On
1084 
1085 ;phar.cache_list =
1086 
1087 [Syslog]
1088 ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
1089 ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
1090 ; runtime, you can define these variables by calling define_syslog_variables().
1091 ; http://php.net/define-syslog-variables
1092 define_syslog_variables  = Off
1093 
1094 [mail function]
1095 ; For Win32 only.
1096 ; http://php.net/smtp
1097 SMTP = localhost
1098 ; http://php.net/smtp-port
1099 smtp_port = 25
1100 
1101 ; For Win32 only.
1102 ; http://php.net/sendmail-from
1103 ;sendmail_from = me@example.com
1104 
1105 ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
1106 ; http://php.net/sendmail-path
1107 ;sendmail_path =
1108 
1109 ; Force the addition of the specified parameters to be passed as extra parameters
1110 ; to the sendmail binary. These parameters will always replace the value of
1111 ; the 5th parameter to mail(), even in safe mode.
1112 ;mail.force_extra_parameters =
1113 
1114 ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
1115 mail.add_x_header = On
1116 
1117 ; The path to a log file that will log all mail() calls. Log entries include
1118 ; the full path of the script, line number, To address and headers.
1119 ;mail.log =
1120 
1121 [SQL]
1122 ; http://php.net/sql.safe-mode
1123 sql.safe_mode = Off
1124 
1125 [ODBC]
1126 ; http://php.net/odbc.default-db
1127 ;odbc.default_db    =  Not yet implemented
1128 
1129 ; http://php.net/odbc.default-user
1130 ;odbc.default_user  =  Not yet implemented
1131 
1132 ; http://php.net/odbc.default-pw
1133 ;odbc.default_pw    =  Not yet implemented
1134 
1135 ; Controls the ODBC cursor model.
1136 ; Default: SQL_CURSOR_STATIC (default).
1137 ;odbc.default_cursortype
1138 
1139 ; Allow or prevent persistent links.
1140 ; http://php.net/odbc.allow-persistent
1141 odbc.allow_persistent = On
1142 
1143 ; Check that a connection is still valid before reuse.
1144 ; http://php.net/odbc.check-persistent
1145 odbc.check_persistent = On
1146 
1147 ; Maximum number of persistent links.  -1 means no limit.
1148 ; http://php.net/odbc.max-persistent
1149 odbc.max_persistent = -1
1150 
1151 ; Maximum number of links (persistent + non-persistent).  -1 means no limit.
1152 ; http://php.net/odbc.max-links
1153 odbc.max_links = -1
1154 
1155 ; Handling of LONG fields.  Returns number of bytes to variables.  0 means
1156 ; passthru.
1157 ; http://php.net/odbc.defaultlrl
1158 odbc.defaultlrl = 4096
1159 
1160 ; Handling of binary data.  0 means passthru, 1 return as is, 2 convert to char.
1161 ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
1162 ; of odbc.defaultlrl and odbc.defaultbinmode
1163 ; http://php.net/odbc.defaultbinmode
1164 odbc.defaultbinmode = 1
1165 
1166 ;birdstep.max_links = -1
1167 
1168 [Interbase]
1169 ; Allow or prevent persistent links.
1170 ibase.allow_persistent = 1
1171 
1172 ; Maximum number of persistent links.  -1 means no limit.
1173 ibase.max_persistent = -1
1174 
1175 ; Maximum number of links (persistent + non-persistent).  -1 means no limit.
1176 ibase.max_links = -1
1177 
1178 ; Default database name for ibase_connect().
1179 ;ibase.default_db =
1180 
1181 ; Default username for ibase_connect().
1182 ;ibase.default_user =
1183 
1184 ; Default password for ibase_connect().
1185 ;ibase.default_password =
1186 
1187 ; Default charset for ibase_connect().
1188 ;ibase.default_charset =
1189 
1190 ; Default timestamp format.
1191 ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
1192 
1193 ; Default date format.
1194 ibase.dateformat = "%Y-%m-%d"
1195 
1196 ; Default time format.
1197 ibase.timeformat = "%H:%M:%S"
1198 
1199 [MySQL]
1200 ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
1201 ; http://php.net/mysql.allow_local_infile
1202 mysql.allow_local_infile = On
1203 
1204 ; Allow or prevent persistent links.
1205 ; http://php.net/mysql.allow-persistent
1206 mysql.allow_persistent = On
1207 
1208 ; If mysqlnd is used: Number of cache slots for the internal result set cache
1209 ; http://php.net/mysql.cache_size
1210 mysql.cache_size = 2000
1211 
1212 ; Maximum number of persistent links.  -1 means no limit.
1213 ; http://php.net/mysql.max-persistent
1214 mysql.max_persistent = -1
1215 
1216 ; Maximum number of links (persistent + non-persistent).  -1 means no limit.
1217 ; http://php.net/mysql.max-links
1218 mysql.max_links = -1
1219 
1220 ; Default port number for mysql_connect().  If unset, mysql_connect() will use
1221 ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
1222 ; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
1223 ; at MYSQL_PORT.
1224 ; http://php.net/mysql.default-port
1225 mysql.default_port =
1226 
1227 ; Default socket name for local MySQL connects.  If empty, uses the built-in
1228 ; MySQL defaults.
1229 ; http://php.net/mysql.default-socket
1230 mysql.default_socket =
1231 
1232 ; Default host for mysql_connect() (doesn't apply in safe mode).
1233 ; http://php.net/mysql.default-host
1234 mysql.default_host =
1235 
1236 ; Default user for mysql_connect() (doesn't apply in safe mode).
1237 ; http://php.net/mysql.default-user
1238 mysql.default_user =
1239 
1240 ; Default password for mysql_connect() (doesn't apply in safe mode).
1241 ; Note that this is generally a *bad* idea to store passwords in this file.
1242 ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
1243 ; and reveal this password!  And of course, any users with read access to this
1244 ; file will be able to reveal the password as well.
1245 ; http://php.net/mysql.default-password
1246 mysql.default_password =
1247 
1248 ; Maximum time (in seconds) for connect timeout. -1 means no limit
1249 ; http://php.net/mysql.connect-timeout
1250 mysql.connect_timeout = 60
1251 
1252 ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
1253 ; SQL-Errors will be displayed.
1254 ; http://php.net/mysql.trace-mode
1255 mysql.trace_mode = Off
1256 
1257 [MySQLi]
1258 
1259 ; Maximum number of persistent links.  -1 means no limit.
1260 ; http://php.net/mysqli.max-persistent
1261 mysqli.max_persistent = -1
1262 
1263 ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
1264 ; http://php.net/mysqli.allow_local_infile
1265 ;mysqli.allow_local_infile = On
1266 
1267 ; Allow or prevent persistent links.
1268 ; http://php.net/mysqli.allow-persistent
1269 mysqli.allow_persistent = On
1270 
1271 ; Maximum number of links.  -1 means no limit.
1272 ; http://php.net/mysqli.max-links
1273 mysqli.max_links = -1
1274 
1275 ; If mysqlnd is used: Number of cache slots for the internal result set cache
1276 ; http://php.net/mysqli.cache_size
1277 mysqli.cache_size = 2000
1278 
1279 ; Default port number for mysqli_connect().  If unset, mysqli_connect() will use
1280 ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
1281 ; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
1282 ; at MYSQL_PORT.
1283 ; http://php.net/mysqli.default-port
1284 mysqli.default_port = 3306
1285 
1286 ; Default socket name for local MySQL connects.  If empty, uses the built-in
1287 ; MySQL defaults.
1288 ; http://php.net/mysqli.default-socket
1289 mysqli.default_socket =
1290 
1291 ; Default host for mysql_connect() (doesn't apply in safe mode).
1292 ; http://php.net/mysqli.default-host
1293 mysqli.default_host =
1294 
1295 ; Default user for mysql_connect() (doesn't apply in safe mode).
1296 ; http://php.net/mysqli.default-user
1297 mysqli.default_user =
1298 
1299 ; Default password for mysqli_connect() (doesn't apply in safe mode).
1300 ; Note that this is generally a *bad* idea to store passwords in this file.
1301 ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
1302 ; and reveal this password!  And of course, any users with read access to this
1303 ; file will be able to reveal the password as well.
1304 ; http://php.net/mysqli.default-pw
1305 mysqli.default_pw =
1306 
1307 ; Allow or prevent reconnect
1308 mysqli.reconnect = Off
1309 
1310 [mysqlnd]
1311 ; Enable / Disable collection of general statistics by mysqlnd which can be
1312 ; used to tune and monitor MySQL operations.
1313 ; http://php.net/mysqlnd.collect_statistics
1314 mysqlnd.collect_statistics = On
1315 
1316 ; Enable / Disable collection of memory usage statistics by mysqlnd which can be
1317 ; used to tune and monitor MySQL operations.
1318 ; http://php.net/mysqlnd.collect_memory_statistics
1319 mysqlnd.collect_memory_statistics = Off
1320 
1321 ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
1322 ; http://php.net/mysqlnd.net_cmd_buffer_size
1323 ;mysqlnd.net_cmd_buffer_size = 2048
1324 
1325 ; Size of a pre-allocated buffer used for reading data sent by the server in
1326 ; bytes.
1327 ; http://php.net/mysqlnd.net_read_buffer_size
1328 ;mysqlnd.net_read_buffer_size = 32768
1329 
1330 [OCI8]
1331 
1332 ; Connection: Enables privileged connections using external
1333 ; credentials (OCI_SYSOPER, OCI_SYSDBA)
1334 ; http://php.net/oci8.privileged-connect
1335 ;oci8.privileged_connect = Off
1336 
1337 ; Connection: The maximum number of persistent OCI8 connections per
1338 ; process. Using -1 means no limit.
1339 ; http://php.net/oci8.max-persistent
1340 ;oci8.max_persistent = -1
1341 
1342 ; Connection: The maximum number of seconds a process is allowed to
1343 ; maintain an idle persistent connection. Using -1 means idle
1344 ; persistent connections will be maintained forever.
1345 ; http://php.net/oci8.persistent-timeout
1346 ;oci8.persistent_timeout = -1
1347 
1348 ; Connection: The number of seconds that must pass before issuing a
1349 ; ping during oci_pconnect() to check the connection validity. When
1350 ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
1351 ; pings completely.
1352 ; http://php.net/oci8.ping-interval
1353 ;oci8.ping_interval = 60
1354 
1355 ; Connection: Set this to a user chosen connection class to be used
1356 ; for all pooled server requests with Oracle 11g Database Resident
1357 ; Connection Pooling (DRCP).  To use DRCP, this value should be set to
1358 ; the same string for all web servers running the same application,
1359 ; the database pool must be configured, and the connection string must
1360 ; specify to use a pooled server.
1361 ;oci8.connection_class =
1362 
1363 ; High Availability: Using On lets PHP receive Fast Application
1364 ; Notification (FAN) events generated when a database node fails. The
1365 ; database must also be configured to post FAN events.
1366 ;oci8.events = Off
1367 
1368 ; Tuning: This option enables statement caching, and specifies how
1369 ; many statements to cache. Using 0 disables statement caching.
1370 ; http://php.net/oci8.statement-cache-size
1371 ;oci8.statement_cache_size = 20
1372 
1373 ; Tuning: Enables statement prefetching and sets the default number of
1374 ; rows that will be fetched automatically after statement execution.
1375 ; http://php.net/oci8.default-prefetch
1376 ;oci8.default_prefetch = 100
1377 
1378 ; Compatibility. Using On means oci_close() will not close
1379 ; oci_connect() and oci_new_connect() connections.
1380 ; http://php.net/oci8.old-oci-close-semantics
1381 ;oci8.old_oci_close_semantics = Off
1382 
1383 [PostgreSQL]
1384 ; Allow or prevent persistent links.
1385 ; http://php.net/pgsql.allow-persistent
1386 pgsql.allow_persistent = On
1387 
1388 ; Detect broken persistent links always with pg_pconnect().
1389 ; Auto reset feature requires a little overheads.
1390 ; http://php.net/pgsql.auto-reset-persistent
1391 pgsql.auto_reset_persistent = Off
1392 
1393 ; Maximum number of persistent links.  -1 means no limit.
1394 ; http://php.net/pgsql.max-persistent
1395 pgsql.max_persistent = -1
1396 
1397 ; Maximum number of links (persistent+non persistent).  -1 means no limit.
1398 ; http://php.net/pgsql.max-links
1399 pgsql.max_links = -1
1400 
1401 ; Ignore PostgreSQL backends Notice message or not.
1402 ; Notice message logging require a little overheads.
1403 ; http://php.net/pgsql.ignore-notice
1404 pgsql.ignore_notice = 0
1405 
1406 ; Log PostgreSQL backends Notice message or not.
1407 ; Unless pgsql.ignore_notice=0, module cannot log notice message.
1408 ; http://php.net/pgsql.log-notice
1409 pgsql.log_notice = 0
1410 
1411 [Sybase-CT]
1412 ; Allow or prevent persistent links.
1413 ; http://php.net/sybct.allow-persistent
1414 sybct.allow_persistent = On
1415 
1416 ; Maximum number of persistent links.  -1 means no limit.
1417 ; http://php.net/sybct.max-persistent
1418 sybct.max_persistent = -1
1419 
1420 ; Maximum number of links (persistent + non-persistent).  -1 means no limit.
1421 ; http://php.net/sybct.max-links
1422 sybct.max_links = -1
1423 
1424 ; Minimum server message severity to display.
1425 ; http://php.net/sybct.min-server-severity
1426 sybct.min_server_severity = 10
1427 
1428 ; Minimum client message severity to display.
1429 ; http://php.net/sybct.min-client-severity
1430 sybct.min_client_severity = 10
1431 
1432 ; Set per-context timeout
1433 ; http://php.net/sybct.timeout
1434 ;sybct.timeout=
1435 
1436 ;sybct.packet_size
1437 
1438 ; The maximum time in seconds to wait for a connection attempt to succeed before returning failure.
1439 ; Default: one minute
1440 ;sybct.login_timeout=
1441 
1442 ; The name of the host you claim to be connecting from, for display by sp_who.
1443 ; Default: none
1444 ;sybct.hostname=
1445 
1446 ; Allows you to define how often deadlocks are to be retried. -1 means "forever".
1447 ; Default: 0
1448 ;sybct.deadlock_retry_count=
1449 
1450 [bcmath]
1451 ; Number of decimal digits for all bcmath functions.
1452 ; http://php.net/bcmath.scale
1453 bcmath.scale = 0
1454 
1455 [browscap]
1456 ; http://php.net/browscap
1457 ;browscap = extra/browscap.ini
1458 
1459 [Session]
1460 ; Handler used to store/retrieve data.
1461 ; http://php.net/session.save-handler
1462 session.save_handler = files
1463 
1464 ; Argument passed to save_handler.  In the case of files, this is the path
1465 ; where data files are stored. Note: Windows users have to change this
1466 ; variable in order to use PHP's session functions.
1467 ;
1468 ; The path can be defined as:
1469 ;
1470 ;     session.save_path = "N;/path"
1471 ;
1472 ; where N is an integer.  Instead of storing all the session files in
1473 ; /path, what this will do is use subdirectories N-levels deep, and
1474 ; store the session data in those directories.  This is useful if you
1475 ; or your OS have problems with lots of files in one directory, and is
1476 ; a more efficient layout for servers that handle lots of sessions.
1477 ;
1478 ; NOTE 1: PHP will not create this directory structure automatically.
1479 ;         You can use the script in the ext/session dir for that purpose.
1480 ; NOTE 2: See the section on garbage collection below if you choose to
1481 ;         use subdirectories for session storage
1482 ;
1483 ; The file storage module creates files using mode 600 by default.
1484 ; You can change that by using
1485 ;
1486 ;     session.save_path = "N;MODE;/path"
1487 ;
1488 ; where MODE is the octal representation of the mode. Note that this
1489 ; does not overwrite the process's umask.
1490 ; http://php.net/session.save-path
1491 ;session.save_path = "/tmp"
1492 
1493 ; Whether to use cookies.
1494 ; http://php.net/session.use-cookies
1495 session.use_cookies = 1
1496 
1497 ; http://php.net/session.cookie-secure
1498 ;session.cookie_secure =
1499 
1500 ; This option forces PHP to fetch and use a cookie for storing and maintaining
1501 ; the session id. We encourage this operation as it's very helpful in combating
1502 ; session hijacking when not specifying and managing your own session id. It is
1503 ; not the end all be all of session hijacking defense, but it's a good start.
1504 ; http://php.net/session.use-only-cookies
1505 session.use_only_cookies = 1
1506 
1507 ; Name of the session (used as cookie name).
1508 ; http://php.net/session.name
1509 session.name = PHPSESSID
1510 
1511 ; Initialize session on request startup.
1512 ; http://php.net/session.auto-start
1513 session.auto_start = 0
1514 
1515 ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
1516 ; http://php.net/session.cookie-lifetime
1517 session.cookie_lifetime = 0
1518 
1519 ; The path for which the cookie is valid.
1520 ; http://php.net/session.cookie-path
1521 session.cookie_path = /
1522 
1523 ; The domain for which the cookie is valid.
1524 ; http://php.net/session.cookie-domain
1525 session.cookie_domain =
1526 
1527 ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
1528 ; http://php.net/session.cookie-httponly
1529 session.cookie_httponly =
1530 
1531 ; Handler used to serialize data.  php is the standard serializer of PHP.
1532 ; http://php.net/session.serialize-handler
1533 session.serialize_handler = php
1534 
1535 ; Defines the probability that the 'garbage collection' process is started
1536 ; on every session initialization. The probability is calculated by using
1537 ; gc_probability/gc_divisor. Where session.gc_probability is the numerator
1538 ; and gc_divisor is the denominator in the equation. Setting this value to 1
1539 ; when the session.gc_divisor value is 100 will give you approximately a 1% chance
1540 ; the gc will run on any give request.
1541 ; Default Value: 1
1542 ; Development Value: 1
1543 ; Production Value: 1
1544 ; http://php.net/session.gc-probability
1545 session.gc_probability = 1
1546 
1547 ; Defines the probability that the 'garbage collection' process is started on every
1548 ; session initialization. The probability is calculated by using the following equation:
1549 ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and
1550 ; session.gc_divisor is the denominator in the equation. Setting this value to 1
1551 ; when the session.gc_divisor value is 100 will give you approximately a 1% chance
1552 ; the gc will run on any give request. Increasing this value to 1000 will give you
1553 ; a 0.1% chance the gc will run on any give request. For high volume production servers,
1554 ; this is a more efficient approach.
1555 ; Default Value: 100
1556 ; Development Value: 1000
1557 ; Production Value: 1000
1558 ; http://php.net/session.gc-divisor
1559 session.gc_divisor = 1000
1560 
1561 ; After this number of seconds, stored data will be seen as 'garbage' and
1562 ; cleaned up by the garbage collection process.
1563 ; http://php.net/session.gc-maxlifetime
1564 session.gc_maxlifetime = 1440
1565 
1566 ; NOTE: If you are using the subdirectory option for storing session files
1567 ;       (see session.save_path above), then garbage collection does *not*
1568 ;       happen automatically.  You will need to do your own garbage
1569 ;       collection through a shell script, cron entry, or some other method.
1570 ;       For example, the following script would is the equivalent of
1571 ;       setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
1572 ;          find /path/to/sessions -cmin +24 | xargs rm
1573 
1574 ; PHP 4.2 and less have an undocumented feature/bug that allows you to
1575 ; to initialize a session variable in the global scope, even when register_globals
1576 ; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
1577 ; You can disable the feature and the warning separately. At this time,
1578 ; the warning is only displayed, if bug_compat_42 is enabled. This feature
1579 ; introduces some serious security problems if not handled correctly. It's
1580 ; recommended that you do not use this feature on production servers. But you
1581 ; should enable this on development servers and enable the warning as well. If you
1582 ; do not enable the feature on development servers, you won't be warned when it's
1583 ; used and debugging errors caused by this can be difficult to track down.
1584 ; Default Value: On
1585 ; Development Value: On
1586 ; Production Value: Off
1587 ; http://php.net/session.bug-compat-42
1588 session.bug_compat_42 = Off
1589 
1590 ; This setting controls whether or not you are warned by PHP when initializing a
1591 ; session value into the global space. session.bug_compat_42 must be enabled before
1592 ; these warnings can be issued by PHP. See the directive above for more information.
1593 ; Default Value: On
1594 ; Development Value: On
1595 ; Production Value: Off
1596 ; http://php.net/session.bug-compat-warn
1597 session.bug_compat_warn = Off
1598 
1599 ; Check HTTP Referer to invalidate externally stored URLs containing ids.
1600 ; HTTP_REFERER has to contain this substring for the session to be
1601 ; considered as valid.
1602 ; http://php.net/session.referer-check
1603 session.referer_check =
1604 
1605 ; How many bytes to read from the file.
1606 ; http://php.net/session.entropy-length
1607 session.entropy_length = 0
1608 
1609 ; Specified here to create the session id.
1610 ; http://php.net/session.entropy-file
1611 ; On systems that don't have /dev/urandom /dev/arandom can be used
1612 ; On windows, setting the entropy_length setting will activate the 
1613 ; Windows random source (using the CryptoAPI)
1614 ;session.entropy_file = /dev/urandom
1615 
1616 ; Set to {nocache,private,public,} to determine HTTP caching aspects
1617 ; or leave this empty to avoid sending anti-caching headers.
1618 ; http://php.net/session.cache-limiter
1619 session.cache_limiter = nocache
1620 
1621 ; Document expires after n minutes.
1622 ; http://php.net/session.cache-expire
1623 session.cache_expire = 180
1624 
1625 ; trans sid support is disabled by default.
1626 ; Use of trans sid may risk your users security.
1627 ; Use this option with caution.
1628 ; - User may send URL contains active session ID
1629 ;   to other person via. email/irc/etc.
1630 ; - URL that contains active session ID may be stored
1631 ;   in publicly accessible computer.
1632 ; - User may access your site with the same session ID
1633 ;   always using URL stored in browser's history or bookmarks.
1634 ; http://php.net/session.use-trans-sid
1635 session.use_trans_sid = 0
1636 
1637 ; Select a hash function for use in generating session ids.
1638 ; Possible Values
1639 ;   0  (MD5 128 bits)
1640 ;   1  (SHA-1 160 bits)
1641 ; This option may also be set to the name of any hash function supported by
1642 ; the hash extension. A list of available hashes is returned by the hash_algos()
1643 ; function.
1644 ; http://php.net/session.hash-function
1645 session.hash_function = 0
1646 
1647 ; Define how many bits are stored in each character when converting
1648 ; the binary hash data to something readable.
1649 ; Possible values:
1650 ;   4  (4 bits: 0-9, a-f)
1651 ;   5  (5 bits: 0-9, a-v)
1652 ;   6  (6 bits: 0-9, a-z, A-Z, "-", ",")
1653 ; Default Value: 4
1654 ; Development Value: 5
1655 ; Production Value: 5
1656 ; http://php.net/session.hash-bits-per-character
1657 session.hash_bits_per_character = 5
1658 
1659 ; The URL rewriter will look for URLs in a defined set of HTML tags.
1660 ; form/fieldset are special; if you include them here, the rewriter will
1661 ; add a hidden <input> field with the info which is otherwise appended
1662 ; to URLs.  If you want XHTML conformity, remove the form entry.
1663 ; Note that all valid entries require a "=", even if no value follows.
1664 ; Default Value: "a=href,area=href,frame=src,form=,fieldset="
1665 ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
1666 ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
1667 ; http://php.net/url-rewriter.tags
1668 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
1669 
1670 [MSSQL]
1671 ; Allow or prevent persistent links.
1672 mssql.allow_persistent = On
1673 
1674 ; Maximum number of persistent links.  -1 means no limit.
1675 mssql.max_persistent = -1
1676 
1677 ; Maximum number of links (persistent+non persistent).  -1 means no limit.
1678 mssql.max_links = -1
1679 
1680 ; Minimum error severity to display.
1681 mssql.min_error_severity = 10
1682 
1683 ; Minimum message severity to display.
1684 mssql.min_message_severity = 10
1685 
1686 ; Compatibility mode with old versions of PHP 3.0.
1687 mssql.compatability_mode = Off
1688 
1689 ; Connect timeout
1690 ;mssql.connect_timeout = 5
1691 
1692 ; Query timeout
1693 ;mssql.timeout = 60
1694 
1695 ; Valid range 0 - 2147483647.  Default = 4096.
1696 ;mssql.textlimit = 4096
1697 
1698 ; Valid range 0 - 2147483647.  Default = 4096.
1699 ;mssql.textsize = 4096
1700 
1701 ; Limits the number of records in each batch.  0 = all records in one batch.
1702 ;mssql.batchsize = 0
1703 
1704 ; Specify how datetime and datetim4 columns are returned
1705 ; On => Returns data converted to SQL server settings
1706 ; Off => Returns values as YYYY-MM-DD hh:mm:ss
1707 ;mssql.datetimeconvert = On
1708 
1709 ; Use NT authentication when connecting to the server
1710 mssql.secure_connection = Off
1711 
1712 ; Specify max number of processes. -1 = library default
1713 ; msdlib defaults to 25
1714 ; FreeTDS defaults to 4096
1715 ;mssql.max_procs = -1
1716 
1717 ; Specify client character set.
1718 ; If empty or not set the client charset from freetds.conf is used
1719 ; This is only used when compiled with FreeTDS
1720 ;mssql.charset = "ISO-8859-1"
1721 
1722 [Assertion]
1723 ; Assert(expr); active by default.
1724 ; http://php.net/assert.active
1725 ;assert.active = On
1726 
1727 ; Issue a PHP warning for each failed assertion.
1728 ; http://php.net/assert.warning
1729 ;assert.warning = On
1730 
1731 ; Don't bail out by default.
1732 ; http://php.net/assert.bail
1733 ;assert.bail = Off
1734 
1735 ; User-function to be called if an assertion fails.
1736 ; http://php.net/assert.callback
1737 ;assert.callback = 0
1738 
1739 ; Eval the expression with current error_reporting().  Set to true if you want
1740 ; error_reporting(0) around the eval().
1741 ; http://php.net/assert.quiet-eval
1742 ;assert.quiet_eval = 0
1743 
1744 [COM]
1745 ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
1746 ; http://php.net/com.typelib-file
1747 ;com.typelib_file =
1748 
1749 ; allow Distributed-COM calls
1750 ; http://php.net/com.allow-dcom
1751 ;com.allow_dcom = true
1752 
1753 ; autoregister constants of a components typlib on com_load()
1754 ; http://php.net/com.autoregister-typelib
1755 ;com.autoregister_typelib = true
1756 
1757 ; register constants casesensitive
1758 ; http://php.net/com.autoregister-casesensitive
1759 ;com.autoregister_casesensitive = false
1760 
1761 ; show warnings on duplicate constant registrations
1762 ; http://php.net/com.autoregister-verbose
1763 ;com.autoregister_verbose = true
1764 
1765 ; The default character set code-page to use when passing strings to and from COM objects.
1766 ; Default: system ANSI code page
1767 ;com.code_page=
1768 
1769 [mbstring]
1770 ; language for internal character representation.
1771 ; http://php.net/mbstring.language
1772 ;mbstring.language = Japanese
1773 
1774 ; internal/script encoding.
1775 ; Some encoding cannot work as internal encoding.
1776 ; (e.g. SJIS, BIG5, ISO-2022-*)
1777 ; http://php.net/mbstring.internal-encoding
1778 ;mbstring.internal_encoding = EUC-JP
1779 
1780 ; http input encoding.
1781 ; http://php.net/mbstring.http-input
1782 ;mbstring.http_input = auto
1783 
1784 ; http output encoding. mb_output_handler must be
1785 ; registered as output buffer to function
1786 ; http://php.net/mbstring.http-output
1787 ;mbstring.http_output = SJIS
1788 
1789 ; enable automatic encoding translation according to
1790 ; mbstring.internal_encoding setting. Input chars are
1791 ; converted to internal encoding by setting this to On.
1792 ; Note: Do _not_ use automatic encoding translation for
1793 ;       portable libs/applications.
1794 ; http://php.net/mbstring.encoding-translation
1795 ;mbstring.encoding_translation = Off
1796 
1797 ; automatic encoding detection order.
1798 ; auto means
1799 ; http://php.net/mbstring.detect-order
1800 ;mbstring.detect_order = auto
1801 
1802 ; substitute_character used when character cannot be converted
1803 ; one from another
1804 ; http://php.net/mbstring.substitute-character
1805 ;mbstring.substitute_character = none;
1806 
1807 ; overload(replace) single byte functions by mbstring functions.
1808 ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
1809 ; etc. Possible values are 0,1,2,4 or combination of them.
1810 ; For example, 7 for overload everything.
1811 ; 0: No overload
1812 ; 1: Overload mail() function
1813 ; 2: Overload str*() functions
1814 ; 4: Overload ereg*() functions
1815 ; http://php.net/mbstring.func-overload
1816 ;mbstring.func_overload = 0
1817 
1818 ; enable strict encoding detection.
1819 ;mbstring.strict_detection = Off
1820 
1821 ; This directive specifies the regex pattern of content types for which mb_output_handler()
1822 ; is activated.
1823 ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
1824 ;mbstring.http_output_conv_mimetype=
1825 
1826 ; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte
1827 ; Default: ""
1828 ;mbstring.script_encoding=
1829 
1830 [gd]
1831 ; Tell the jpeg decode to ignore warnings and try to create
1832 ; a gd image. The warning will then be displayed as notices
1833 ; disabled by default
1834 ; http://php.net/gd.jpeg-ignore-warning
1835 ;gd.jpeg_ignore_warning = 0
1836 
1837 [exif]
1838 ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
1839 ; With mbstring support this will automatically be converted into the encoding
1840 ; given by corresponding encode setting. When empty mbstring.internal_encoding
1841 ; is used. For the decode settings you can distinguish between motorola and
1842 ; intel byte order. A decode setting cannot be empty.
1843 ; http://php.net/exif.encode-unicode
1844 ;exif.encode_unicode = ISO-8859-15
1845 
1846 ; http://php.net/exif.decode-unicode-motorola
1847 ;exif.decode_unicode_motorola = UCS-2BE
1848 
1849 ; http://php.net/exif.decode-unicode-intel
1850 ;exif.decode_unicode_intel    = UCS-2LE
1851 
1852 ; http://php.net/exif.encode-jis
1853 ;exif.encode_jis =
1854 
1855 ; http://php.net/exif.decode-jis-motorola
1856 ;exif.decode_jis_motorola = JIS
1857 
1858 ; http://php.net/exif.decode-jis-intel
1859 ;exif.decode_jis_intel    = JIS
1860 
1861 [Tidy]
1862 ; The path to a default tidy configuration file to use when using tidy
1863 ; http://php.net/tidy.default-config
1864 ;tidy.default_config = /usr/local/lib/php/default.tcfg
1865 
1866 ; Should tidy clean and repair output automatically?
1867 ; WARNING: Do not use this option if you are generating non-html content
1868 ; such as dynamic images
1869 ; http://php.net/tidy.clean-output
1870 tidy.clean_output = Off
1871 
1872 [soap]
1873 ; Enables or disables WSDL caching feature.
1874 ; http://php.net/soap.wsdl-cache-enabled
1875 soap.wsdl_cache_enabled=1
1876 
1877 ; Sets the directory name where SOAP extension will put cache files.
1878 ; http://php.net/soap.wsdl-cache-dir
1879 soap.wsdl_cache_dir="/tmp"
1880 
1881 ; (time to live) Sets the number of second while cached file will be used
1882 ; instead of original one.
1883 ; http://php.net/soap.wsdl-cache-ttl
1884 soap.wsdl_cache_ttl=86400
1885 
1886 ; Sets the size of the cache limit. (Max. number of WSDL files to cache)
1887 soap.wsdl_cache_limit = 5
1888 
1889 [sysvshm]
1890 ; A default size of the shared memory segment
1891 ;sysvshm.init_mem = 10000
1892 
1893 [ldap]
1894 ; Sets the maximum number of open links or -1 for unlimited.
1895 ldap.max_links = -1
1896 
1897 [mcrypt]
1898 ; For more information about mcrypt settings see http://php.net/mcrypt-module-open
1899 
1900 ; Directory where to load mcrypt algorithms
1901 ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
1902 ;mcrypt.algorithms_dir=
1903 
1904 ; Directory where to load mcrypt modes
1905 ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
1906 ;mcrypt.modes_dir=
1907 
1908 [dba]
1909 ;dba.default_handler=
1910 
1911 [xsl]
1912 ; Write operations from within XSLT are disabled by default.
1913 ; XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_NETWORK | XSL_SECPREF_WRITE_FILE = 44
1914 ; Set it to 0 to allow all operations
1915 ;xsl.security_prefs = 44
1916 
1917 ; Local Variables:
1918 ; tab-width: 4
1919 ; End:
1920 extension = "gettext.so"
php.ini

 

##配置PHP的进程管理文件 -->php-fpm

cd  /usr/local/php/etc
cp php-fpm.conf.default  php-fpm.conf
vim php-fpm.conf              -->参见04.php-fpm_config.conf

;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;

; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr/local/php-5.3.27). This prefix can be dynamicaly changed by using the
; '-p' argument from the command line.

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
;  - the global prefix if it's been set (-p arguement)
;  - /usr/local/php-5.3.27 otherwise
;include=etc/fpm.d/*.conf

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;

[global]
; Pid file
; Note: the default prefix is /usr/local/php-5.3.27/var
; Default Value: none
pid = /usr/local/php/logs/php-fpm.pid

; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; in a local file.
; Note: the default prefix is /usr/local/php-5.3.27/var
; Default Value: log/php-fpm.log
error_log = /usr/local/php/logs/php-fpm.log

; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
; will be handled differently.
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
; Default Value: daemon
;syslog.facility = daemon

; syslog_ident is prepended to every message. If you have multiple FPM
; instances running on the same server, you can change the default value
; which must suit common needs.
; Default Value: php-fpm
;syslog.ident = php-fpm

; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
log_level = error

; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
;emergency_restart_threshold = 0

; Interval of time used by emergency_restart_interval to determine when 
; a graceful restart will be initiated.  This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;emergency_restart_interval = 0

; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;process_control_timeout = 0

; The maximum number of processes FPM will fork. This has been design to control
; the global number of processes when using dynamic PM within a lot of pools.
; Use it with caution.
; Note: A value of 0 indicates no limit
; Default Value: 0
; process.max = 128

; Specify the nice(2) priority to apply to the master process (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
;       - The pool process will inherit the master process priority
;         unless it specified otherwise
; Default Value: no set
; process.priority = -19

; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
;daemonize = yes
 
; Set open file descriptor rlimit for the master process.
; Default Value: system defined value
rlimit_files = 32768
 
; Set max core size rlimit for the master process.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0

; Specify the event mechanism FPM will use. The following is available:
; - select     (any POSIX os)
; - poll       (any POSIX os)
; - epoll      (linux >= 2.5.44)
; - kqueue     (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
; - /dev/poll  (Solaris >= 7)
; - port       (Solaris >= 10)
; Default Value: not set (auto detection)
events.mechanism = epoll

;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ; 
;;;;;;;;;;;;;;;;;;;;

; Multiple pools of child processes may be started with different listening
; ports and different management options.  The name of the pool will be
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)

; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www]

; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr/local/php-5.3.27) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
user = nginx
group = nginx

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses on a
;                            specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000

; Set listen(2) backlog. A value of '-1' means unlimited.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
;listen.backlog = -1

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions. 
; Default Values: user and group are set as the running user
;                 mode is set to 0666
listen.owner = nginx
listen.group = nginx
;listen.mode = 0666
 
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
;listen.allowed_clients = 127.0.0.1

; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
;       - The pool processes will inherit the master process priority
;         unless it specified otherwise
; Default Value: no set
; priority = -19

; Choose how the process manager will control the number of child processes.
; Possible Values:
;   static  - a fixed number (pm.max_children) of child processes;
;   dynamic - the number of child processes are set dynamically based on the
;             following directives. With this process management, there will be
;             always at least 1 children.
;             pm.max_children      - the maximum number of children that can
;                                    be alive at the same time.
;             pm.start_servers     - the number of children created on startup.
;             pm.min_spare_servers - the minimum number of children in 'idle'
;                                    state (waiting to process). If the number
;                                    of 'idle' processes is less than this
;                                    number then some children will be created.
;             pm.max_spare_servers - the maximum number of children in 'idle'
;                                    state (waiting to process). If the number
;                                    of 'idle' processes is greater than this
;                                    number then some children will be killed.
;  ondemand - no children are created at startup. Children will be forked when
;             new requests will connect. The following parameter are used:
;             pm.max_children           - the maximum number of children that
;                                         can be alive at the same time.
;             pm.process_idle_timeout   - The number of seconds after which
;                                         an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic

; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 1024

; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 16

; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 5

; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 20

; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 15s;
 
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 2048

; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
;   pool                 - the name of the pool;
;   process manager      - static, dynamic or ondemand;
;   start time           - the date and time FPM has started;
;   start since          - number of seconds since FPM has started;
;   accepted conn        - the number of request accepted by the pool;
;   listen queue         - the number of request in the queue of pending
;                          connections (see backlog in listen(2));
;   max listen queue     - the maximum number of requests in the queue
;                          of pending connections since FPM has started;
;   listen queue len     - the size of the socket queue of pending connections;
;   idle processes       - the number of idle processes;
;   active processes     - the number of active processes;
;   total processes      - the number of idle + active processes;
;   max active processes - the maximum number of active processes since FPM
;                          has started;
;   max children reached - number of times, the process limit has been reached,
;                          when pm tries to start more children (works only for
;                          pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
;   pool:                 www
;   process manager:      static
;   start time:           01/Jul/2011:17:53:49 +0200
;   start since:          62636
;   accepted conn:        190460
;   listen queue:         0
;   max listen queue:     1
;   listen queue len:     42
;   idle processes:       4
;   active processes:     11
;   total processes:      15
;   max active processes: 12
;   max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
;   http://www.foo.bar/status
;   http://www.foo.bar/status?json
;   http://www.foo.bar/status?html
;   http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example: 
;   http://www.foo.bar/status?full
;   http://www.foo.bar/status?json&full
;   http://www.foo.bar/status?html&full
;   http://www.foo.bar/status?xml&full
; The Full status returns for each process:
;   pid                  - the PID of the process;
;   state                - the state of the process (Idle, Running, ...);
;   start time           - the date and time the process has started;
;   start since          - the number of seconds since the process has started;
;   requests             - the number of requests the process has served;
;   request duration     - the duration in 碌s of the requests;
;   request method       - the request method (GET, POST, ...);
;   request URI          - the request URI with the query string;
;   content length       - the content length of the request (only with POST);
;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
;   script               - the main script called (or '-' if not set);
;   last request cpu     - the %cpu the last request consumed
;                          it's always 0 if the process is not in Idle state
;                          because CPU calculation is done when the request
;                          processing has terminated;
;   last request memory  - the max amount of memory the last request consumed
;                          it's always 0 if the process is not in Idle state
;                          because memory calculation is done when the request
;                          processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
;   ************************
;   pid:                  31330
;   state:                Running
;   start time:           01/Jul/2011:17:53:49 +0200
;   start since:          63087
;   requests:             12808
;   request duration:     1250261
;   request method:       GET
;   request URI:          /test_mem.php?N=10000
;   content length:       0
;   user:                 -
;   script:               /home/fat/web/docs/php/test_mem.php
;   last request cpu:     0.00
;   last request memory:  0
;
; Note: There is a real-time FPM status monitoring sample web page available
;       It's available in: /usr/local/php-5.3.27/share/php/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set 
;pm.status_path = /status
 
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping

; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong

; The access log file
; Default: not set
;access.log = log/$pool.access.log

; The access log format.
; The following syntax is allowed
;  %%: the '%' character
;  %C: %CPU used by the request
;      it can accept the following format:
;      - %{user}C for user CPU only
;      - %{system}C for system CPU only
;      - %{total}C  for user + system CPU (default)
;  %d: time taken to serve the request
;      it can accept the following format:
;      - %{seconds}d (default)
;      - %{miliseconds}d
;      - %{mili}d
;      - %{microseconds}d
;      - %{micro}d
;  %e: an environment variable (same as $_ENV or $_SERVER)
;      it must be associated with embraces to specify the name of the env
;      variable. Some exemples:
;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
;  %f: script filename
;  %l: content-length of the request (for POST request only)
;  %m: request method
;  %M: peak of memory allocated by PHP
;      it can accept the following format:
;      - %{bytes}M (default)
;      - %{kilobytes}M
;      - %{kilo}M
;      - %{megabytes}M
;      - %{mega}M
;  %n: pool name
;  %o: ouput header
;      it must be associated with embraces to specify the name of the header:
;      - %{Content-Type}o
;      - %{X-Powered-By}o
;      - %{Transfert-Encoding}o
;      - ....
;  %p: PID of the child that serviced the request
;  %P: PID of the parent of the child that serviced the request
;  %q: the query string 
;  %Q: the '?' character if query string exists
;  %r: the request URI (without the query string, see %q and %Q)
;  %R: remote IP address
;  %s: status (response code)
;  %t: server time the request was received
;      it can accept a strftime(3) format:
;      %d/%b/%Y:%H:%M:%S %z (default)
;  %T: time the log has been written (the request has finished)
;      it can accept a strftime(3) format:
;      %d/%b/%Y:%H:%M:%S %z (default)
;  %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
 
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /usr/local/php/logs/$pool.log.slow
 
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 10
 
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
 
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
 
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
 
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever 
;       possible. However, all PHP paths will be relative to the chroot
;       (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot = 
 
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www
 
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes

; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5
 
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
;   php_value/php_flag             - you can set classic ini defines which can
;                                    be overwritten from PHP call 'ini_set'. 
;   php_admin_value/php_admin_flag - these directives won't be overwritten by
;                                     PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.

; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local/php-5.3.27)

; Default Value: nothing is defined by default except the values in php.ini and
;                specified at startup with the -d argument
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f 6233@qq.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 132M
php_admin_value[max_input_time ] = 300
php_admin_value[upload_max_filesize] = 2M
php_admin_value[post_max_size] = 16M
php_admin_value[max_execution_time] = 300
vim /usr/local/php/etc/php-fpm.conf

 

##启动php-fpm

useradd nginx -M -s /nologin
id nginx
mkdir -p /usr/local/php/logs
/usr/local/php/sbin/php-fpm            -->启动服务
  echo "/usr/local/php/sbin/php-fpm " >>/etc/rc.local
ss -lnput|grep php-fpm                 -->监听本机9000端口

image

## 查看php启动

php -m

## 设置service启动

1. 编辑 vim /etc/init.d/php

2. 添加权限  chmod 755 /etc/init.d/php

#!/bin/bash
# php Startup script for the php HTTP Server
# it is v.0.0.2 version.
# chkconfig: - 85 15
# description: php is a high-performance web and proxy server.
#              It has a lot of features, but it's not for everyone.
# processname: php
# pidfile: /usr/local/php/logs/php-fpm.pid
# config: /usr/local/php/etc/php-fpm.conf
phpd=/usr/local/php/sbin/php-fpm
php_config=/usr/local/php/etc/php-fpm.conf
php_pid=/usr/local/php/logs/php-fpm.pid
RETVAL=0
prog="php"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $phpd ] || exit 0
# Start php daemons functions.
start() {
if [ -e $php_pid ];then
   echo "php already running...."
   exit 1
fi
   echo -n $"Starting $prog: "
   daemon $phpd -c ${php_config}
   RETVAL=$?
   echo
   [ $RETVAL = 0 ] && touch /var/lock/subsys/php
   return $RETVAL
}
# Stop php daemons functions.
stop() {
        echo -n $"Stopping $prog: "
        killproc $phpd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/php ${php_pid}
}
# reload php service functions.
reload() {
    echo -n $"Reloading $prog: "
    #kill -HUP `cat ${php_pid}`
    killproc $phpd -HUP
    RETVAL=$?
    echo
}
# See how we were called.
case "$1" in
start)
        start
        ;;
stop)
        stop
        ;;
reload)
        reload
        ;;
restart)
        stop
        start
        ;;
status)
        status $prog
        RETVAL=$?
        ;;
*)
        echo $"Usage: $prog {start|stop|restart|reload|status|help}"
        exit 1
esac
exit $RETVAL
vim /etc/init.d/php

## php的扩展安装

关于gettext的warning问题解决[未安装,需要扩展安装]

cd /opt/tools/php-5.3.27/ext/gettext
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make;make install 
vim /usr/local/php/lib/php.ini            # 之前的文件已配置,是为zabbix安装做的准备
     extension = "gettext.so"
修改后测试服务:/usr/local/php/sbin/php-fpm -t
停止服务 pkill php-fpm
启动服务 /usr/local/php/sbin/php-fpm

 

(可以尝试更改文件名称解决)

可选:使用memcache内存软件实现保存会话保持

php实现内存缓存  -->修改配置文件既可  -->需要提前布置好memcache
	sed -n '1461p' /usr/local/php/lib/php.ini
		session.save_handler = files   -->memcache
	sed -n '1490p' /usr/local/php/lib/php.ini 
		session.save_path = "/tmp"     -->"tcp:192.168.25.150:11544"  

##测试nginx<-->php之间通讯(PHP服务已经开启)
####实际就是配置location,添加端口传递

cat /usr/local/nginx/conf/nginx.conf       -->不需要大的变动(如果使用了include的话)
vim /usr/local/nginx/conf/extra/blog.conf  -->配置端口转发以及root根文件路径
     server {
        listen       88;
        server_name  www.blog.com;
        root   html/blog;
        location / {
            index  index.html index.htm;
        } 
        location ~.*\.(php|php5)?$ {
             fastcgi_pass  127.0.0.1:9000;
             fastcgi_index index.php;
             include  fastcgi.conf;
        }
        access_log logs/access_blog.log main;
    }
cd /usr/local/nginx/html/blog
vim phpinfo.php
    <?php
        phpinfo();
    ?>    
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -s reload


更改本地hosts文件

C:\Windows\System32\drivers\etc
  192.168.25.144  www.blog.com  blog.com
查看http://www.blog.com:88/phpinfo.php

image

##测试php<-->mysql之间通讯(Mysql服务已经开启)

ps -ef |grep mysqld
    vim /usr/local/nginx/html/blog/test_php.php
        <?php
            $link_id=mysql_connect('localhost','root','root') or mysql_error();
            if($link_id){
                echo "mysql is Ok ,Congratulation";
            }else{
                echo "Sorry,you can see logs of mysql";
                echo mysql_error();
            }
    ?>


查看http://www.blog.com:88/test_php.php

image

查看http://www.blog.com:88/error_test.php

image

ll /usr/local/mysql/lib/|grep libmysqlclient.so.18

 

posted @ 2018-07-12 22:05  小a玖拾柒  阅读(2320)  评论(0编辑  收藏  举报