Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

nginx 1.15.12 でPHP(php-fpm)を実行する

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 igore sysoevさんと一緒

 

今回は、nginxでPHP(php-fpm)を利用する方法の紹介です。

 

 

1.nginx/php-fpmのインストール

作業はCentOS7で実施しています。

[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

 

 

[root@localhost ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo CentOS-fasttrack.repo pgdg-redhat-all.repo zabbix.repo
[root@localhost ~]# vi /etc/yum.repos.d/nginx.repo
[root@localhost ~]# cat /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
[root@localhost ~]# yum search nginx
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* extras: ftp.jaist.ac.jp
* updates: ftp.jaist.ac.jp
nginx | 2.9 kB 00:00:00
nginx/7/x86_64/primary_db | 142 kB 00:00:02
================================================================================ N/S matched: nginx ================================================================================
nginx-debug.x86_64 : debug version of nginx
nginx-debuginfo.x86_64 : Debug information for package nginx
nginx-module-geoip.x86_64 : nginx GeoIP dynamic modules
nginx-module-geoip-debuginfo.x86_64 : Debug information for package nginx-module-geoip
nginx-module-image-filter.x86_64 : nginx image filter dynamic module
nginx-module-image-filter-debuginfo.x86_64 : Debug information for package nginx-module-image-filter
nginx-module-njs.x86_64 : nginx njs dynamic modules
nginx-module-njs-debuginfo.x86_64 : Debug information for package nginx-module-njs
nginx-module-perl.x86_64 : nginx Perl dynamic module
nginx-module-perl-debuginfo.x86_64 : Debug information for package nginx-module-perl
nginx-module-xslt.x86_64 : nginx xslt dynamic module
nginx-module-xslt-debuginfo.x86_64 : Debug information for package nginx-module-xslt
nginx-nr-agent.noarch : New Relic agent for NGINX and NGINX Plus
pcp-pmda-nginx.x86_64 : Performance Co-Pilot (PCP) metrics for the Nginx Webserver
nginx.x86_64 : High performance web server
unit.x86_64 : NGINX Unit
unit-devel.x86_64 : NGINX Unit (development tools)

Name and summary matches only, use "search all" for everything.
[root@localhost ~]# yum -y install nginx
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* extras: ftp.jaist.ac.jp
* updates: ftp.jaist.ac.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ nginx.x86_64 1:1.15.12-1.el7.ngx を インストール
--> 依存性解決を終了しました。

依存性を解決しました

====================================================================================================================================================================================
Package アーキテクチャー バージョン リポジトリー 容量
====================================================================================================================================================================================
インストール中:
nginx x86_64 1:1.15.12-1.el7.ngx nginx 766 k

トランザクションの要約
====================================================================================================================================================================================
インストール 1 パッケージ

総ダウンロード容量: 766 k
インストール容量: 2.7 M
Downloading packages:
nginx-1.15.12-1.el7.ngx.x86_64.rpm | 766 kB 00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : 1:nginx-1.15.12-1.el7.ngx.x86_64 1/1
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* http://nginx.org/en/support.html

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------
検証中 : 1:nginx-1.15.12-1.el7.ngx.x86_64 1/1

インストール:
nginx.x86_64 1:1.15.12-1.el7.ngx

完了しました!
[root@localhost ~]# rpm -qa | grep nginx
nginx-1.15.12-1.el7.ngx.x86_64

 

php-fpmも同様にyumでインストールします。

[root@localhost html]# yum list | grep php-fpm
php-fpm.x86_64 5.4.16-46.el7 base
[root@localhost html]# yum -y install php-fpm
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* extras: ftp.jaist.ac.jp
* updates: ftp.jaist.ac.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ php-fpm.x86_64 0:5.4.16-46.el7 を インストール
--> 依存性解決を終了しました。

依存性を解決しました

====================================================================================================================================================================================
Package アーキテクチャー バージョン リポジトリー 容量
====================================================================================================================================================================================
インストール中:
php-fpm x86_64 5.4.16-46.el7 base 1.4 M

トランザクションの要約
====================================================================================================================================================================================
インストール 1 パッケージ

総ダウンロード容量: 1.4 M
インストール容量: 4.5 M
Downloading packages:
php-fpm-5.4.16-46.el7.x86_64.rpm | 1.4 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : php-fpm-5.4.16-46.el7.x86_64 1/1
検証中 : php-fpm-5.4.16-46.el7.x86_64 1/1

インストール:
php-fpm.x86_64 0:5.4.16-46.el7

完了しました!

 

 

2.nginxの設定

nginxの設定ファイルである「/etc/nginx/conf.d/default.conf」を編集します。

赤字の部分を設定します。

なお、38行目にある「$document_root」ですが、

serverディレクティブ配下の5行目にあるroot(ドキュメントルート)を指しています。

[root@localhost ~]# vi /etc/nginx/conf.d/default.conf
[root@localhost ~]# cat -n /etc/nginx/conf.d/default.conf
1 server {
2 listen 80;
3 server_name localhost;
4 #root /usr/share/nginx/html/zabbix/zabbix;
5 root /usr/share/nginx/html;
6
7 #charset koi8-r;
8 #access_log /var/log/nginx/host.access.log main;
9
10 #location / {
11 # root /usr/share/nginx/html;
12 # root /usr/share/nginx/html/zabbix;
13 # index index.html index.htm;
14 #}
15
16 #error_page 404 /404.html;
17
18 # redirect server error pages to the static page /50x.html
19 #
20 error_page 500 502 503 504 /50x.html;
21 location = /50x.html {
22 root /usr/share/nginx/html;
23 }
24
25 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
26 #
27 #location ~ \.php$ {
28 # proxy_pass http://127.0.0.1;
29 #}
30
31 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
32 #
33 location ~ \.php$ {
34 #root html;
35 fastcgi_pass 127.0.0.1:9000;
36 fastcgi_index index.php;
37 #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
38 fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
39 include fastcgi_params;
40 }
41
42 # deny access to .htaccess files, if Apache's document root
43 # concurs with nginx's one
44 #
45 #location ~ /\.ht {
46 # deny all;
47 #}
48 }
49

 

 

3.PHP(php-fpm)の設定

まず、/etc/php.iniを編集します。

882行目でタイムゾーン「date.timezone = Asia/Tokyo」を設定、

385行目で「max_execution_time」・396行目で「max_input_time」・675行目で「post_max_size」をカスタマイズします。

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

 

もう一つ、/etc/php-fpm.d/www.confを編集します。

40行目と43行目にあるuser/groupがデフォルトではapacheとなっているので、

それをnginxに変更します。

oot@localhost html]# vi /etc/php-fpm.d/www.conf
[root@localhost html]# cat -n /etc/php-fpm.d/www.conf
1 ; Start a new pool named 'www'.
2 [www]
3
4 ; The address on which to accept FastCGI requests.
5 ; Valid syntaxes are:
6 ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
7 ; a specific port;
8 ; 'port' - to listen on a TCP socket to all addresses on a
9 ; specific port;
10 ; '/path/to/unix/socket' - to listen on a unix socket.
11 ; Note: This value is mandatory.
12 listen = 127.0.0.1:9000
13
14 ; Set listen(2) backlog. A value of '-1' means unlimited.
15 ; Default Value: -1
16 ;listen.backlog = -1
17
18 ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
19 ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
20 ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
21 ; must be separated by a comma. If this value is left blank, connections will be
22 ; accepted from any ip address.
23 ; Default Value: any
24 listen.allowed_clients = 127.0.0.1
25
26 ; Set permissions for unix socket, if one is used. In Linux, read/write
27 ; permissions must be set in order to allow connections from a web server. Many
28 ; BSD-derived systems allow connections regardless of permissions.
29 ; Default Values: user and group are set as the running user
30 ; mode is set to 0666
31 ;listen.owner = nobody
32 ;listen.group = nobody
33 ;listen.mode = 0666
34
35 ; Unix user/group of processes
36 ; Note: The user is mandatory. If the group is not set, the default user's group
37 ; will be used.
38 ; RPM: apache Choosed to be able to access some dir as httpd
39 ;user = apache
40 user = nginx
41 ; RPM: Keep a group allowed to write in log dir.
42 ;group = apache
43 group = nginx
44
45 ; Choose how the process manager will control the number of child processes.
46 ; Possible Values:
47 ; static - a fixed number (pm.max_children) of child processes;
48 ; dynamic - the number of child processes are set dynamically based on the
49 ; following directives:
50 ; pm.max_children - the maximum number of children that can
51 ; be alive at the same time.
52 ; pm.start_servers - the number of children created on startup.
53 ; pm.min_spare_servers - the minimum number of children in 'idle'
54 ; state (waiting to process). If the number
55 ; of 'idle' processes is less than this
56 ; number then some children will be created.
57 ; pm.max_spare_servers - the maximum number of children in 'idle'
58 ; state (waiting to process). If the number
59 ; of 'idle' processes is greater than this
60 ; number then some children will be killed.
61 ; Note: This value is mandatory.
62 pm = dynamic
63
64 ; The number of child processes to be created when pm is set to 'static' and the
65 ; maximum number of child processes to be created when pm is set to 'dynamic'.
66 ; This value sets the limit on the number of simultaneous requests that will be
67 ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
68 ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
69 ; CGI.
70 ; Note: Used when pm is set to either 'static' or 'dynamic'
71 ; Note: This value is mandatory.
72 pm.max_children = 50
73
74 ; The number of child processes created on startup.
75 ; Note: Used only when pm is set to 'dynamic'
76 ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
77 pm.start_servers = 5
78
79 ; The desired minimum number of idle server processes.
80 ; Note: Used only when pm is set to 'dynamic'
81 ; Note: Mandatory when pm is set to 'dynamic'
82 pm.min_spare_servers = 5
83
84 ; The desired maximum number of idle server processes.
85 ; Note: Used only when pm is set to 'dynamic'
86 ; Note: Mandatory when pm is set to 'dynamic'
87 pm.max_spare_servers = 35
88
89 ; The number of requests each child process should execute before respawning.
90 ; This can be useful to work around memory leaks in 3rd party libraries. For
91 ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
92 ; Default Value: 0
93 ;pm.max_requests = 500
94
95 ; The URI to view the FPM status page. If this value is not set, no URI will be
96 ; recognized as a status page. By default, the status page shows the following
97 ; information:
98 ; accepted conn - the number of request accepted by the pool;
99 ; pool - the name of the pool;
100 ; process manager - static or dynamic;
101 ; idle processes - the number of idle processes;
102 ; active processes - the number of active processes;
103 ; total processes - the number of idle + active processes.
104 ; The values of 'idle processes', 'active processes' and 'total processes' are
105 ; updated each second. The value of 'accepted conn' is updated in real time.
106 ; Example output:
107 ; accepted conn: 12073
108 ; pool: www
109 ; process manager: static
110 ; idle processes: 35
111 ; active processes: 65
112 ; total processes: 100
113 ; By default the status page output is formatted as text/plain. Passing either
114 ; 'html' or 'json' as a query string will return the corresponding output
115 ; syntax. Example:
116 ; http://www.foo.bar/status
117 ; http://www.foo.bar/status?json
118 ; http://www.foo.bar/status?html
119 ; Note: The value must start with a leading slash (/). The value can be
120 ; anything, but it may not be a good idea to use the .php extension or it
121 ; may conflict with a real PHP file.
122 ; Default Value: not set
123 ;pm.status_path = /status
124
125 ; The ping URI to call the monitoring page of FPM. If this value is not set, no
126 ; URI will be recognized as a ping page. This could be used to test from outside
127 ; that FPM is alive and responding, or to
128 ; - create a graph of FPM availability (rrd or such);
129 ; - remove a server from a group if it is not responding (load balancing);
130 ; - trigger alerts for the operating team (24/7).
131 ; Note: The value must start with a leading slash (/). The value can be
132 ; anything, but it may not be a good idea to use the .php extension or it
133 ; may conflict with a real PHP file.
134 ; Default Value: not set
135 ;ping.path = /ping
136
137 ; This directive may be used to customize the response of a ping request. The
138 ; response is formatted as text/plain with a 200 response code.
139 ; Default Value: pong
140 ;ping.response = pong
141
142 ; The timeout for serving a single request after which the worker process will
143 ; be killed. This option should be used when the 'max_execution_time' ini option
144 ; does not stop script execution for some reason. A value of '0' means 'off'.
145 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
146 ; Default Value: 0
147 ;request_terminate_timeout = 0
148
149 ; The timeout for serving a single request after which a PHP backtrace will be
150 ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
151 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
152 ; Default Value: 0
153 ;request_slowlog_timeout = 0
154
155 ; The log file for slow requests
156 ; Default Value: not set
157 ; Note: slowlog is mandatory if request_slowlog_timeout is set
158 slowlog = /var/log/php-fpm/www-slow.log
159
160 ; Set open file descriptor rlimit.
161 ; Default Value: system defined value
162 ;rlimit_files = 1024
163
164 ; Set max core size rlimit.
165 ; Possible Values: 'unlimited' or an integer greater or equal to 0
166 ; Default Value: system defined value
167 ;rlimit_core = 0
168
169 ; Chroot to this directory at the start. This value must be defined as an
170 ; absolute path. When this value is not set, chroot is not used.
171 ; Note: chrooting is a great security feature and should be used whenever
172 ; possible. However, all PHP paths will be relative to the chroot
173 ; (error_log, sessions.save_path, ...).
174 ; Default Value: not set
175 ;chroot =
176
177 ; Chdir to this directory at the start. This value must be an absolute path.
178 ; Default Value: current directory or / when chroot
179 ;chdir = /var/www
180
181 ; Redirect worker stdout and stderr into main error log. If not set, stdout and
182 ; stderr will be redirected to /dev/null according to FastCGI specs.
183 ; Default Value: no
184 ;catch_workers_output = yes
185
186 ; Limits the extensions of the main script FPM will allow to parse. This can
187 ; prevent configuration mistakes on the web server side. You should only limit
188 ; FPM to .php extensions to prevent malicious users to use other extensions to
189 ; exectute php code.
190 ; Note: set an empty value to allow all extensions.
191 ; Default Value: .php
192 ;security.limit_extensions = .php .php3 .php4 .php5
193
194 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
195 ; the current environment.
196 ; Default Value: clean env
197 ;env[HOSTNAME] = $HOSTNAME
198 ;env[PATH] = /usr/local/bin:/usr/bin:/bin
199 ;env[TMP] = /tmp
200 ;env[TMPDIR] = /tmp
201 ;env[TEMP] = /tmp
202
203 ; Additional php.ini defines, specific to this pool of workers. These settings
204 ; overwrite the values previously defined in the php.ini. The directives are the
205 ; same as the PHP SAPI:
206 ; php_value/php_flag - you can set classic ini defines which can
207 ; be overwritten from PHP call 'ini_set'.
208 ; php_admin_value/php_admin_flag - these directives won't be overwritten by
209 ; PHP call 'ini_set'
210 ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
211
212 ; Defining 'extension' will load the corresponding shared extension from
213 ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
214 ; overwrite previously defined php.ini values, but will append the new value
215 ; instead.
216
217 ; Default Value: nothing is defined by default except the values in php.ini and
218 ; specified at startup with the -d argument
219 ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
220 ;php_flag[display_errors] = off
221 php_admin_value[error_log] = /var/log/php-fpm/www-error.log
222 php_admin_flag[log_errors] = on
223 ;php_admin_value[memory_limit] = 128M
224
225 ; Set session path to a directory owned by process user
226 php_value[session.save_handler] = files
227 php_value[session.save_path] = /var/lib/php/session

 

 

4.PHPコンテンツファイル(index.php)の作成

nginxのドキュメントルート(/usr/share/nginx/html)配下にindex.phpを作成します。

[root@localhost ~]# cat /usr/share/nginx/html/index.php
<?php
phpinfo();
?>

 

 

5.nginx/php-fpmの起動

 nginx/php-fpmの起動をします。

※自動起動設定も併せて実施しておきます。

[root@localhost ~]# systemctl start nginx php-fpm
[root@localhost ~]# systemctl status nginx php-fpm
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since 月 2019-05-06 16:43:35 JST; 5s ago
Docs: http://nginx.org/en/docs/
Process: 9240 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 9261 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 9263 (nginx)
CGroup: /system.slice/nginx.service
├─9263 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
└─9264 nginx: worker process

5月 6 16:43:34 localhost.localdomain systemd[1]: Starting nginx - high performance web server...
5月 6 16:43:35 localhost.localdomain systemd[1]: PID file /var/run/nginx.pid not readable (yet?) after start.
5月 6 16:43:35 localhost.localdomain systemd[1]: Started nginx - high performance web server.

● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
Active: active (running) since 月 2019-05-06 16:43:35 JST; 5s ago
Main PID: 9262 (php-fpm)
Status: "Ready to handle connections"
CGroup: /system.slice/php-fpm.service
├─9262 php-fpm: master process (/etc/php-fpm.conf)
├─9265 php-fpm: pool www
├─9266 php-fpm: pool www
├─9267 php-fpm: pool www
├─9268 php-fpm: pool www
└─9269 php-fpm: pool www

5月 6 16:43:34 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
5月 6 16:43:35 localhost.localdomain systemd[1]: Started The PHP FastCGI Process Manager.
[root@localhost ~]# systemctl enable nginx php-fpm
[root@localhost ~]# systemctl is-enabled nginx php-fpm
enabled
enabled

 

 

6.ブラウザからのアクセス

 ブラウザから「http://nginxIP/index.php」へアクセスします。

phpinfoの画面1

 

 下の方を見ると「nginx」と書かれている箇所があり、

nginx上でPHPが処理されていることが確認できます。

phpinfoの画面2

 

また、nginxのアクセスログ(/var/log/nginx/access.log)を見ても、

アクセス確認が出来ます。

[root@localhost ~]# tail -f /var/log/nginx/access.log
192.168.77.22 - - [09/May/2019:16:52:52 +0900] "GET /index.php HTTP/1.1" 200 48929 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36" "-"
192.168.77.22 - - [09/May/2019:16:52:52 +0900] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2536 "http://192.168.77.61/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36" "-"
192.168.77.22 - - [09/May/2019:16:52:52 +0900] "GET /index.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2158 "http://192.168.77.61/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36" "-"

 

 

ハマりどころ・トラブルシュートなど

 ・/etc/nginx/conf.d/default.confの設定

「location ~ /.php」の部分の「fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;」の書き方、

$document_rootがserverディレクティブのrootを指していることなど、

気をつければ大丈夫かと思います。

 

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Opensourcetech by Takahiro Kujirai