1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-30 02:52:08 +02:00
Files
archived-doc-ja/reference/errorfunc/ini.xml
TAKAGI Masahiro 9da46d0f14 sync with en.
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@201592 c90b9560-bf6c-de11-be94-00142212c4b1
2005-11-29 15:32:44 +00:00

462 lines
16 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.8 $ -->
<!-- EN-Revision: 1.30 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: takagi -->
<section id="errorfunc.configuration">
&reftitle.runtime;
&extension.runtime;
<para>
<table>
<title>エラーおよびロギング設定オプション</title>
<tgroup cols="3">
<thead>
<row>
<entry>名前</entry>
<entry>デフォルト</entry>
<entry>変更の可否</entry>
<entry>変更履歴</entry>
</row>
</thead>
<tbody>
<row>
<entry>error_reporting</entry>
<entry>NULL</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>display_errors</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>display_startup_errors</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP 4.0.3 以降で有効です。</entry>
</row>
<row>
<entry>log_errors</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>log_errors_max_len</entry>
<entry>"1024"</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP 4.3.0 以降で有効です。</entry>
</row>
<row>
<entry>ignore_repeated_errors</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP 4.3.0 以降で有効です。</entry>
</row>
<row>
<entry>ignore_repeated_source</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP 4.3.0 以降で有効です。</entry>
</row>
<row>
<entry>report_memleaks</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP 4.3.0 以降で有効です。</entry>
</row>
<row>
<entry>track_errors</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>html_errors</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP &lt;= 4.2.3 では PHP_INI_SYSTEM 。PHP 4.0.2 以降で有効です。</entry>
</row>
<row>
<entry>docref_root</entry>
<entry>""</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP 4.3.0 以降で有効です。</entry>
</row>
<row>
<entry>docref_ext</entry>
<entry>""</entry>
<entry>PHP_INI_ALL</entry>
<entry>PHP 4.3.2 以降で有効です。</entry>
</row>
<row>
<entry>error_prepend_string</entry>
<entry>NULL</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>error_append_string</entry>
<entry>NULL</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>error_log</entry>
<entry>NULL</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>warn_plus_overloading</entry>
<entry>NULL</entry>
<entry>PHP_INI??</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
&ini.php.constants;
</para>
<para>
以下に設定ディレクティブの簡単な説明を示します。
<variablelist>
<varlistentry id="ini.error-reporting">
<term>
<parameter>error_reporting</parameter>
<type>integer</type>
</term>
<listitem>
<para>
エラー出力レベルを設定します。パラメータは、あるビットフィールドを表
す整数か定数名で指定します。このerror_reportingのレベルと定数は、
<link linkend="errorfunc.constants">定義済の定数</link>および
&php.ini;に記述されています。 実行時に設定するには、
<function>error_reporting</function> 関数を指定してください。
<link linkend="ini.display-errors">display_errors</link>
ディレクティブも参照してください。
</para>
<para>
PHP 4とPHP 5のデフォルトは E_ALL &amp; ~E_NOTICE です。
この設定は<constant>E_NOTICE</constant>レベルのエラーは出力されません。
開発時にはこのエラーを表示させたい場合もあるかもしれません。
</para>
<note>
<para>
開発時に<constant>E_NOTICE</constant>を有効にすることにはいくつ
かの利点があります。デバッグのために、NOTICE メッセージはコード
の中のバグの可能性について警告を与えます。例えば、代入されていな
い値を使用した場合は、警告を発生します。
これは、書き間違いを見付け、デバッグの時間を節約するために非常
に有用です。NOTICEメッセージは、好ましくないコードに警告します。
例えば、$arr[item] は $arr['item'] と書く方が好ましいです。
これは、PHPが"item"を定数として取り扱うためです。
定数でない場合、PHPは配列の添字ようの文字列と判断します。
</para>
</note>
<note>
<para>
PHP 5では新しいエラーレベル<constant>E_STRICT</constant>を使用できます。
<constant>E_STRICT</constant><constant>E_ALL</constant>には
含まれないため、明示的にこのエラーレベルを設定する必要があります。
開発中に<constant>E_STRICT</constant>を有効にすることは
いくつかの利点があります。STRICTメッセージは最新かつもっとも有効で
推奨されるコーディングメソッドを使用するように手助けしてくれます。
例えば推奨されない関数を使用したさいに警告を発します。
</para>
</note>
<para>
PHP 3では、<literal>(E_ERROR | E_WARNING | E_PARSE)</literal>
デフォルトの設定で、同じことを意味しました。しかし、PHP 3の
<filename>php3.ini</filename>では定数がサポートされていないため、
error_reportingの設定は数値で指定する必要があり、この場合は、
<literal>7</literal>とします。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.display-errors">
<term>
<parameter>display_errors</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
エラーをHTML出力の一部として画面に出力するかどうかを定義します。
</para>
<note>
<para>
開発をサポートする仕組みであり、本番のシステムでは
使用すべきではありません。(例えばインターネットに接続されたシステムなど)
</para>
</note>
<note>
<para>
display_errors は実行時にも設定可能(<function>ini_set</function>
関数を用いてですが、スクリプトが致命的fatalなエラーを発生した場合は
その設定は反映されません。なぜなら、要求されたアクションは
実行されなかったからです。
</para>
</note>
</listitem>
</varlistentry>
<varlistentry id="ini.display-startup-errors">
<term>
<parameter>display_startup_errors</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
display_errorsをonにした場合でも、PHPの起動シーケンスにおいて発
生したエラーは表示されません。デバッグ時を除き、
display_startup_errorsをoffにしておくことが強く推奨されます。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.log-errors">
<term>
<parameter>log_errors</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
エラーメッセージを、サーバーのエラーログまたは<link
linkend="ini.error-log">error_log</link>に記録するかどうかを指定
します。このオプションはサーバーに依存します。
</para>
<note>
<para>
実用Webサイトではエラー表示を行う変わりにエラーを記録することを
強く推奨します。
</para>
</note>
</listitem>
</varlistentry>
<varlistentry id="ini.log-errors-max-len">
<term>
<parameter>log_errors_max_len</parameter>
<type>integer</type>
</term>
<listitem>
<para>
log_errorsの最大長をキロバイト単位で設定します。
<link linkend="ini.error-log">error_log</link> には、
この設定で情報が追加されます。デフォルトは 1024 で、0 を指定すると
最大長の制限は全く適用されなくなります。
この長さはエラーログに記録され、
エラー表示と <link
linkend="reserved.variables.phperrormsg">$php_errormsg</link>
に適用されます。
</para>
&ini.shorthandbytes;
</listitem>
</varlistentry>
<varlistentry id="ini.ignore-repeated-errors">
<term>
<parameter>ignore_repeated_errors</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
繰り返されるメッセージを記録しません。エラーの繰り返しは、
<link
linkend="ini.ignore-repeated-source">ignore_repeated_source</link>
trueに設定されるまで同じファイルの同じ行で発生します。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ignore-repeated-source">
<term>
<parameter>ignore_repeated_source</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
メッセージの繰り返しを無視する場合にメッセージのソースを無視しま
す。この設定をOnにすると、異なるファイルまたはソース行からの同じ
エラーメッセージの繰り返しを記録しなくなります。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.report-memleaks">
<term>
<parameter>report_memleaks</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
このパラメータをOffにした場合、(stdoutまたはログに)メモリーリー
クは表示されなくなります。これは、デバッグ用コンパイル時に
<link linkend="ini.error-reporting">error_reporting</link>
E_WARNINGを有効にしている場合のみ有効です。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.track-errors">
<term>
<parameter>track_errors</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
有効にした場合、直近のエラーメッセージが、
<link
linkend="reserved.variables.phperrormsg">$php_errormsg</link>
数に常に代入されます。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.html-errors">
<term>
<parameter>html_errors</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
エラーメッセージのHTMLタグをオフにします。htmlエラー用の新しい形
式では、ユーザがエラーまたはエラーを発生した関数を説明するページ
に導くようクリック可能なメッセージを出力します。これらのリファレ
ンスは、<link linkend="ini.docref-root">docref_root</link> およ
<link linkend="ini.docref-ext">docref_ext</link>の設定に依存
します。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.docref-root">
<term>
<parameter>docref_root</parameter>
<type>string</type>
</term>
<listitem>
<para>
新しいエラーフォーマットはエラーやエラーの原因となった関数に関するマニュアル
のページの情報を含んでいます。マニュアルのページによっては母国語でダウンロードが
可能であり、このiniディレクティブをマニュアルのローカルコピーのURLにセット
することができます。
マニュアルのローカルコピーが'/manual/'でアクセスできるとすると、単に
<userinput>docref_root=/manual/</userinput>とするだけです。
ローカルコピーのファイルの拡張子は<userinput>docref_ext=.html</userinput>
で指定できます。拡張リファレンスを使用することもできます。例えば
<userinput>docref_root=http://manual/en/</userinput>または
<userinput>docref_root="http://landonize.it/?how=url&amp;theme=classic&amp;filter=Landon&amp;url=http%3A%2F%2Fwww.php.net%2F"</userinput>が使用できます。
</para>
<para>
ほとんどの場合docref_rootの値の最後を'/'にしようと思うでしょう。
しかし上の二つ目の例を見ではその必要はありません。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.docref-ext">
<term>
<parameter>docref_ext</parameter>
<type>string</type>
</term>
<listitem>
<para>
<link linkend="ini.docref-root">docref_root</link>を参照して下さ
い。
</para>
<note>
<para>
docref_extの値はドット '.'で始まる必要があります。
</para>
</note>
</listitem>
</varlistentry>
<varlistentry id="ini.error-prepend-string">
<term>
<parameter>error_prepend_string</parameter>
<type>string</type>
</term>
<listitem>
<para>
エラーメッセージの前に出力する文字列。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.error-append-string">
<term>
<parameter>error_append_string</parameter>
<type>string</type>
</term>
<listitem>
<para>
エラーメッセージの後に出力する文字列。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.error-log">
<term>
<parameter>error_log</parameter>
<type>string</type>
</term>
<listitem>
<para>
スクリプトエラーが記録されるファイル名です。
ファイルはウェブサーバユーザで書き込めなければなりません。
<literal>syslog</literal> が指定されると、エラーはファイルではなく
システムロガーに送られます。これは UNIX では syslog(3) であり
Windows NT ではイベントログのことです。システムロガーは
Windows 95 ではサポートされていません。
<function>syslog</function> も参照してください。
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.warn-plus-overloading">
<term>
<parameter>warn_plus_overloading</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
有効な場合、このオプションは加算演算子 (<literal>+</literal>)
が文字列で使用されている場合に警告を出力します。
これにより、文字列結合演算子 (<literal>.</literal>) を用いて
書き直す必要があるスクリプトを見付けることが容易になります。
このオプションは、PHP 4 には存在しません。
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
<!-- 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:"../../../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
-->