-
Notifications
You must be signed in to change notification settings - Fork 56
/
setup.xml
357 lines (349 loc) · 14.6 KB
/
setup.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: fdd77c27aafa5820c7841328f5ecd21e0a0c2f8a Maintainer: takagi Status: ready -->
<chapter xml:id="wincache.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.setup;
<section xml:id="wincache.requirements">
&reftitle.required;
<para>
この拡張モジュールは、現在は次の構成のみをサポートしています。
</para>
<simpara>Windows OS</simpara>
<itemizedlist spacing="compact">
<listitem>
<simpara>Windows XP SP3 上での IIS 5.1 および <link xlink:href="&url.iis.fastcgi.downloads;">FastCGI Extension</link></simpara>
</listitem>
<listitem>
<simpara>Windows Server 2003 上での IIS 6.0 および <link xlink:href="&url.iis.fastcgi.downloads;">FastCGI Extension</link></simpara>
</listitem>
<listitem>
<simpara>Windows Vista SP1 上での IIS 7.0 および FastCGI Module</simpara>
</listitem>
<listitem>
<simpara>Windows Server 2008 上での IIS 7.0 および FastCGI Module</simpara>
</listitem>
<listitem>
<simpara>Windows 7 上での IIS 7.5 および FastCGI Module</simpara>
</listitem>
<listitem>
<simpara>Windows Server 2008 R2 上での IIS 7.5 および FastCGI Module</simpara>
</listitem>
</itemizedlist>
<simpara>PHP</simpara>
<itemizedlist spacing="compact">
<listitem>
<simpara>PHP 5.2.X, Non-thread-safe build</simpara>
</listitem>
<listitem>
<simpara>PHP 5.3 X86, Non-thread-safe VC9 build</simpara>
</listitem>
</itemizedlist>
<note>
<simpara>
WinCache 拡張モジュールは、IIS の設定で PHP を FastCGI 経由で動かすようにしている場合しか使えません。
</simpara>
</note>
</section>
<section xml:id="wincache.installation">
&reftitle.install;
<para>
&pecl.moved;
</para>
<para>
&pecl.info;
<link xlink:href="&url.pecl.package;wincache">&url.pecl.package;wincache</link>.
</para>
<para>
この拡張モジュールには二種類のパッケージがあります。PHP 5.2.X 用と
PHP 5.3.X 用です。使っている PHP のバージョンにあわせて適切なほうを選びましょう。
</para>
<para>
この拡張モジュールをインストールする手順は次のとおりです。
</para>
<procedure>
<step>
<simpara>
どこか一時的な場所にパッケージを展開します。
</simpara>
</step>
<step>
<simpara>
<filename>php_wincache.dll</filename> を PHP の拡張モジュール用フォルダにコピーします。
このフォルダは、通常は PHP のバイナリファイルがあるフォルダと同じ場所にあって "ext"
という名前です。たとえば <filename>C:\Program Files\PHP\ext</filename> のようになります。
</simpara>
</step>
<step>
<simpara>
php.ini ファイルをテキストエディタで開きます。通常は PHP のバイナリファイルと同じ場所にあります。
たとえば <filename>C:\Program Files\PHP\php.ini</filename> のようになります。
</simpara>
</step>
<step>
<simpara>
php.ini ファイルの最後に
<literal>extension = php_wincache.dll</literal>
という行を追加します。
</simpara>
</step>
<step>
<simpara>
<filename>php.ini</filename> ファイルを保存して終了します。
</simpara>
</step>
<step>
<simpara>
IIS Application Pools for PHP をリサイクルして設定の変更を適用します。
この拡張モジュールが有効になったことを確かめるには、
<link linkend="function.phpinfo">phpinfo</link> 関数をコールする PHP のコードを書いた
<filename>phpinfo.php</filename> というファイルをつくります。
</simpara>
</step>
<step>
<simpara>
PHP を使う IIS ウェブサイトのルートフォルダに
<filename>phpinfo.php</filename> を保存し、
http://localhost/phpinfo.php を開きます。そして、表示されたウェブページから
<literal>wincache</literal> というセクションを探します。
拡張モジュールが有効になっていれば、
<link linkend="function.phpinfo">phpinfo</link>
の出力に WinCache の設定項目が含まれるはずです。
</simpara>
</step>
</procedure>
<note>
<simpara>
拡張モジュールが有効になっていることを確認し終えたら、忘れずに
<filename>phpinfo.php</filename> をウェブサイトのルートフォルダから削除しておきましょう。
</simpara>
</note>
</section>
&reference.wincache.ini;
<section xml:id="wincache.stats">
<title>WinCache 統計スクリプト</title>
<para>
WinCache のインストールパッケージには
<filename>wincache.php</filename> という PHP スクリプトが含まれています。
これを使えば、キャッシュ情報や統計情報を取得することができます。
</para>
<para>
WinCache 拡張モジュールのインストールを Microsoft Web Platform Installer
で行った場合は、このスクリプトの場所は
<filename>%SystemDrive%\Program Files\IIS\Windows Cache for PHP\</filename>
となります。64 ビット版の Windows サーバー OS の場合は
<filename>%SystemDrive%\Program Files (x86)\IIS\Windows Cache for PHP</filename>
です。拡張モジュールを手動でインストールした場合は、
インストールパッケージを展開した場所と同じフォルダに
<filename>wincache.php</filename> があります。
</para>
<para>
<filename>wincache.php</filename> を使うには、
ウェブサイトのルートフォルダあるいはその配下のサブフォルダにこのファイルをコピーします。
スクリプトを保護するために、このファイルをテキストエディタで開いて、定数
<emphasis>USERNAME</emphasis> と <emphasis>PASSWORD</emphasis>
の値を変更しましょう。サーバー上で何らかの IIS 認証を有効にしている場合は、
コメントに書かれている指示に従います。
<example>
<title><filename>wincache.php</filename> 用の認証設定</title>
<programlisting role="php">
<![CDATA[
<?php
/**
* ======================== CONFIGURATION SETTINGS ==============================
* If you do not want to use authentication for this page, set USE_AUTHENTICATION to 0.
* If you use authentication then replace the default password.
*/
define('USE_AUTHENTICATION', 1);
define('USERNAME', 'wincache');
define('PASSWORD', 'wincache');
/**
* The Basic PHP authentication will work only when IIS is configured to support
* Anonymous Authentication' and nothing else. If IIS is configured to support/use
* any other kind of authentication like Basic/Negotiate/Digest etc, this will not work.
* In that case use the array below to define the names of users in your
* domain/network/workgroup which you want to grant access to.
*/
$user_allowed = array('DOMAIN\user1', 'DOMAIN\user2', 'DOMAIN\user3');
/**
* If the array contains string 'all', then all the users authenticated by IIS
* will have access to the page. Uncomment the below line and comment above line
* to grant access to all users who gets authenticated by IIS.
*/
/* $user_allowed = array('all'); */
/** ===================== END OF CONFIGURATION SETTINGS ========================== */
?>
]]>
</programlisting>
</example>
<note>
<simpara>
組み込みの認証あるいはサーバーの認証機構を使って、常に
<filename>wincache.php</filename> スクリプトを保護するようにしましょう。
このスクリプトを保護せずに放置しておくと、アプリケーションやウェブサーバーを危険にさらすことになってしまいます。
</simpara>
</note>
</para>
</section>
<section xml:id="wincache.sessionhandler">
<title>WinCache セッションハンドラ</title>
<para>
WinCache セッションハンドラ (WinCache 1.1.0 以降で使用可能) を使うと、
PHP のセッションデータを共有メモリ上のセッションキャッシュに格納できるようになります。
デフォルトのファイル保存方式のかわりに共有メモリを使うことで、
大量のデータをセッションで扱う PHP アプリケーションのパフォーマンスを向上させることができます。
Wincache のセッションキャッシュはファイルをバックに置いた共有メモリなので、
IIS アプリケーションプールをリサイクルするときにもセッションのデータが失われません。
</para>
<para>
PHP で WinCache セッションハンドラを使うには、<filename>php.ini</filename> の
<link linkend="ini.session.save-handler">session.save_handler</link> を <emphasis>wincache</emphasis>
にします。デフォルトでは、Windows のテンポラリファイルと同じ場所にセッションデータを保存します。
セッションファイルの場所を変えるには
<link linkend="ini.session.save-path">session.save_path</link> ディレクティブを設定します。
<example>
<title>WinCache セッションハンドラの有効化</title>
<programlisting role="php.ini">
<![CDATA[
session.save_handler = wincache
session.save_path = C:\inetpub\temp\session\
]]>
</programlisting>
</example>
</para>
</section>
<section xml:id="wincache.reroutes">
<title>WinCache 関数への切り替え</title>
<para>
<emphasis>注意:</emphasis> <link linkend="ini.wincache.rerouteini">wincache.rerouteini</link>
は WinCache 1.3.7.0 で削除されました。かわりに、自動的な関数置き換え機能を利用します。
<link linkend="ini.wincache.reroute_enabled">wincache.reroute_enabled</link> を参照ください。
</para>
<para>
WinCache の関数切り替え機能 (WinCache 1.2.0 以降で使用可能で、WinCache 1.3.7.0 で削除されました) を使うと、
その用途向けに最適化した同等の関数で組み込みの PHP 関数を置き換えることができます。
WinCache 拡張モジュールには、PHP のファイル操作関数を Windows
向けに最適化した実装が含まれています。PHP でネットワーク共有上のファイルにアクセスする必要がある場合などに、
これを使うとアプリケーションのパフォーマンスを向上させることができるでしょう。
最適化した実装が用意されている関数は、次のとおりです。
</para>
<itemizedlist spacing="compact">
<listitem>
<simpara>
<link linkend="function.file-exists">file_exists</link>
</simpara>
</listitem>
<listitem>
<simpara>
<link linkend="function.file-get-contents">file_get_contents</link>
</simpara>
</listitem>
<listitem>
<simpara>
<link linkend="function.readfile">readfile</link>
</simpara>
</listitem>
<listitem>
<simpara>
<link linkend="function.is-readable">is_readable</link>
</simpara>
</listitem>
<listitem>
<simpara>
<link linkend="function.is-writable">is_writable</link>
</simpara>
</listitem>
<listitem>
<simpara>
<link linkend="function.is-dir">is_dir</link>
</simpara>
</listitem>
<listitem>
<simpara>
<link linkend="function.realpath">realpath</link>
</simpara>
</listitem>
<listitem>
<simpara>
<link linkend="function.filesize">filesize</link>
</simpara>
</listitem>
</itemizedlist>
<para>
WinCache の関数切り替え機能を使えるよう設定するには、WinCache のインストールパッケージに含まれている
<filename>reroute.ini</filename> ファイルを使います。このファイルを
<filename>php.ini</filename> があるディレクトリにコピーしましょう。
それから <filename>php.ini</filename> に wincache.rerouteini
の設定を追加し、ここに <filename>reroute.ini</filename> ファイルへの絶対パスあるいは相対パスを指定します。
<example>
<title>WinCache の関数切り替えの有効化</title>
<programlisting role="php.ini">
<![CDATA[
wincache.rerouteini = C:\PHP\reroute.ini
]]>
</programlisting>
</example>
</para>
<note>
<simpara>
WinCache の関数切り替え機能を使う場合は、ファイルキャッシュのサイズを増やすことを推奨します。
このサイズは <link linkend="ini.wincache.fcachesize">wincache.fcachesize</link> を使って設定します。
</simpara>
</note>
<para>
<filename>reroute.ini</filename> ファイルには、PHP の関数とそれに対応する
WinCache の関数のマッピングを記述します。
ファイルの各行に、次の構文で関数のマッピングを定義します。
</para>
<simpara>
<literal><PHP の関数名>:[<関数のパラメータの数>]=<wincache の関数名></literal>
</simpara>
<para>
ファイルの例を以下に示します。この例では、PHP の関数 <function>file_get_contents</function>
がコールされると、それが <function>wincache_file_get_contents</function> へのコールに置き換えられます。
ただし、関数に渡されたパラメータが 2 個以下の場合に限ります。パラメータ数の指定が役立つのは、
置き換え用の関数が元の関数のすべてのパラメータに対応しているわけではないという場合です。
<example>
<title>Reroute.ini ファイルの内容</title>
<programlisting role="php.ini">
<![CDATA[
[FunctionRerouteList]
file_exists=wincache_file_exists
file_get_contents:2=wincache_file_get_contents
readfile:2=wincache_readfile
is_readable=wincache_is_readable
is_writable=wincache_is_writable
is_writeable=wincache_is_writable
is_file=wincache_is_file
is_dir=wincache_is_dir
realpath=wincache_realpath
filesize=wincache_filesize
]]>
</programlisting>
</example>
</para>
</section>
<section xml:id="wincache.resources">
&reftitle.resources;
&no.resource;
</section>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->