Source of: /manual/fa/errorfunc.configuration.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/errorfunc.setup.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'fa',
),
'this' =>
array (
0 => 'errorfunc.configuration.php',
1 => 'Runtime Configuration',
),
'up' =>
array (
0 => 'errorfunc.setup.php',
1 => 'Installing/Configuring',
),
'prev' =>
array (
0 => 'errorfunc.installation.php',
1 => 'Installation',
),
'next' =>
array (
0 => 'errorfunc.resources.php',
1 => 'Resource Types',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="errorfunc.configuration" class="section">
<h2 class="title">Runtime Configuration</h2>
<p class="simpara">
The behaviour of these functions is affected by settings in <var class="filename">php.ini</var>.
</p>
<p class="para">
<table class="doctable table">
<caption><b>Errors and Logging Configuration Options</b></caption>
<thead valign="middle">
<tr valign="middle">
<th>Name</th>
<th>Default</th>
<th>Changeable</th>
<th>Changelog</th>
</tr>
</thead>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.error-reporting" class="link">error_reporting</a></td>
<td align="left">NULL</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.display-errors" class="link">display_errors</a></td>
<td align="left">"1"</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.display-startup-errors" class="link">display_startup_errors</a></td>
<td align="left">"0"</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.log-errors" class="link">log_errors</a></td>
<td align="left">"0"</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.log-errors-max-len" class="link">log_errors_max_len</a></td>
<td align="left">"1024"</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">Available since PHP 4.3.0.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.ignore-repeated-errors" class="link">ignore_repeated_errors</a></td>
<td align="left">"0"</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">Available since PHP 4.3.0.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.ignore-repeated-source" class="link">ignore_repeated_source</a></td>
<td align="left">"0"</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">Available since PHP 4.3.0.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.report-memleaks" class="link">report_memleaks</a></td>
<td align="left">"1"</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">Available since PHP 4.3.0.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.track-errors" class="link">track_errors</a></td>
<td align="left">"0"</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.html-errors" class="link">html_errors</a></td>
<td align="left">"1"</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">PHP_INI_SYSTEM in PHP <= 4.2.3.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.xmlrpc-errors" class="link">xmlrpc_errors</a></td>
<td align="left">"0"</td>
<td align="left">PHP_INI_SYSTEM</td>
<td align="left">Available since PHP 4.1.0.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.xmlrpc-error-number" class="link">xmlrpc_error_number</a></td>
<td align="left">"0"</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">Available since PHP 4.1.0.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.docref-root" class="link">docref_root</a></td>
<td align="left">""</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">Available since PHP 4.3.0.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.docref-ext" class="link">docref_ext</a></td>
<td align="left">""</td>
<td align="left">PHP_INI_ALL</td>
<td align="left">Available since PHP 4.3.2.</td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.error-prepend-string" class="link">error_prepend_string</a></td>
<td align="left">NULL</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.error-append-string" class="link">error_append_string</a></td>
<td align="left">NULL</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
<tr valign="middle">
<td align="left"><a href="errorfunc.configuration.php#ini.error-log" class="link">error_log</a></td>
<td align="left">NULL</td>
<td align="left">PHP_INI_ALL</td>
<td class="empty"> </td>
</tr>
</tbody>
</table>
For further details and definitions of the
PHP_INI_* modes, see the <a href="configuration.changes.modes.php" class="xref">Where a configuration setting may be set</a>.
</p>
<p class="para">Here's a short explanation of
the configuration directives.</p>
<p class="para">
<dl>
<dt id="ini.error-reporting">
<span class="term">
<i><tt class="parameter">error_reporting</tt></i>
<span class="type"><a href="language.types.integer.php" class="type integer">integer</a></span>
</span>
<dd>
<p class="para">
Set the error reporting level. The parameter is either an integer
representing a bit field, or named constants. The error_reporting
levels and constants are described in
<a href="errorfunc.constants.php" class="link">Predefined Constants</a>,
and in <var class="filename">php.ini</var>. To set at runtime, use the
<span class="function"><a href="function.error-reporting.php" class="function">error_reporting()</a></span> function. See also the
<a href="errorfunc.configuration.php#ini.display-errors" class="link">display_errors</a> directive.
</p>
<p class="para">
In PHP 4 and PHP 5 the default value is <b><tt>E_ALL</tt></b>
& ~<b><tt>E_NOTICE</tt></b>.
This setting does not show <b><tt>E_NOTICE</tt></b> level errors. You
may want to show them during development.
</p>
<blockquote class="note"><p><b class="note">Note</b>:
<p class="para">Enabling <b><tt>E_NOTICE</tt></b> during development has
some benefits. For debugging purposes: NOTICE messages will warn you
about possible bugs in your code. For example, use of unassigned values
is warned. It is extremely useful to find typos and
to save time for debugging. NOTICE messages will warn you about bad style.
For example, <i>$arr[item]</i> is better to be written as
<i>$arr['item']</i> since PHP tries to treat
<i>"item"</i> as constant. If it is not a constant, PHP assumes
it is a string index for the array.
</p>
</p></blockquote>
<blockquote class="note"><p><b class="note">Note</b>:
<p class="para">
In PHP 5 a new error level <b><tt>E_STRICT</tt></b> is available.
As <b><tt>E_STRICT</tt></b> is not included within
<b><tt>E_ALL</tt></b> you have to explicitly enable this kind of
error level. Enabling <b><tt>E_STRICT</tt></b> during development
has some benefits. STRICT messages will help you to use the latest and
greatest suggested method of coding, for example warn you about using
deprecated functions.
</p>
</p></blockquote>
<blockquote class="note"><p><b class="note">Note</b>:
<b>PHP Constants outside of PHP</b><br />
<p class="para">
Using PHP Constants outside of PHP, like in <var class="filename">httpd.conf</var>,
will have no useful meaning so in such cases the <span class="type"><a href="language.types.integer.php" class="type integer">integer</a></span> values
are required. And since error levels will be added over time, the maximum
value (for <b><tt>E_ALL</tt></b>) will likely change. So in place of
<b><tt>E_ALL</tt></b> consider using a larger value to cover all bit
fields from now and well into the future, a numeric value like
<i>2147483647</i> (includes all errors, not just
<b><tt>E_ALL</tt></b>).
</p>
</p></blockquote>
</dd>
</dt>
<dt id="ini.display-errors">
<span class="term">
<i><tt class="parameter">display_errors</tt></i>
<span class="type"><a href="language.types.string.php" class="type string">string</a></span>
</span>
<dd>
<p class="para">
This determines whether errors should be printed to the screen
as part of the output or if they should be hidden from the user.
</p>
<p class="para">
Value <i>"stderr"</i> sends the errors to <i>stderr</i>
instead of <i>stdout</i>. The value is available as of PHP
5.2.4. In earlier versions, this directive was of type <span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>.
</p>
<blockquote class="note"><p><b class="note">Note</b>:
<p class="para">
This is a feature to support your development and should never be used
on production systems (e.g. systems connected to the internet).
</p>
</p></blockquote>
<blockquote class="note"><p><b class="note">Note</b>:
<p class="para">
Although display_errors may be set at runtime (with <span class="function"><a href="function.ini-set.php" class="function">ini_set()</a></span>),
it won't have any affect if the script has fatal errors.
This is because the desired runtime action does not get executed.
</p>
</p></blockquote>
</dd>
</dt>
<dt id="ini.display-startup-errors">
<span class="term">
<i><tt class="parameter">display_startup_errors</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
Even when display_errors is on, errors that occur during PHP's startup
sequence are not displayed. It's strongly recommended to keep
display_startup_errors off, except for debugging.
</p>
</dd>
</dt>
<dt id="ini.log-errors">
<span class="term">
<i><tt class="parameter">log_errors</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
Tells whether script error messages should be logged to the
server's error log or <a href="errorfunc.configuration.php#ini.error-log" class="link">error_log</a>.
This option is thus server-specific.
</p>
<blockquote class="note"><p><b class="note">Note</b>:
<p class="para">
You're strongly advised to use error logging in place of
error displaying on production web sites.
</p>
</p></blockquote>
</dd>
</dt>
<dt id="ini.log-errors-max-len">
<span class="term">
<i><tt class="parameter">log_errors_max_len</tt></i>
<span class="type"><a href="language.types.integer.php" class="type integer">integer</a></span>
</span>
<dd>
<p class="para">
Set the maximum length of log_errors in bytes. In
<a href="errorfunc.configuration.php#ini.error-log" class="link">error_log</a> information about
the source is added. The default is 1024 and 0 allows to not apply
any maximum length at all.
This length is applied to logged errors, displayed errors and also to
<var class="varname"><var class="varname"><a href="reserved.variables.phperrormsg.php" class="classname">$php_errormsg</a></var></var>.
</p>
<span class="simpara">When an <span class="type"><a href="language.types.integer.php" class="type integer">integer</a></span> is used, the
value is measured in bytes. Shorthand notation, as described
in <a href="faq.using.php#faq.using.shorthandbytes" class="link">this FAQ</a>, may also be used.
</span>
</dd>
</dt>
<dt id="ini.ignore-repeated-errors">
<span class="term">
<i><tt class="parameter">ignore_repeated_errors</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
Do not log repeated messages. Repeated errors must occur in the same
file on the same line unless
<a href="errorfunc.configuration.php#ini.ignore-repeated-source" class="link">ignore_repeated_source</a>
is set true.
</p>
</dd>
</dt>
<dt id="ini.ignore-repeated-source">
<span class="term">
<i><tt class="parameter">ignore_repeated_source</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
Ignore source of message when ignoring repeated messages. When this setting
is On you will not log errors with repeated messages from different files or
sourcelines.
</p>
</dd>
</dt>
<dt id="ini.report-memleaks">
<span class="term">
<i><tt class="parameter">report_memleaks</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
If this parameter is set to On (the default), this parameter will show a
report of memory leaks detected by the Zend memory manager. This report
will be send to stderr on Posix platforms. On Windows, it will be send
to the debugger using OutputDebugString(), and can be viewed with tools
like <a href="http://technet.microsoft.com/en-us/sysinternals/bb896647" class="link external">» DbgView</a>.
This parameter only has effect in a debug build, and if
error_reporting includes <b><tt>E_WARNING</tt></b> in the allowed
list.
</p>
</dd>
</dt>
<dt id="ini.track-errors">
<span class="term">
<i><tt class="parameter">track_errors</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
If enabled, the last error message will always be present in the
variable <var class="varname"><var class="varname"><a href="reserved.variables.phperrormsg.php" class="classname">$php_errormsg</a></var></var>.
</p>
</dd>
</dt>
<dt id="ini.html-errors">
<span class="term">
<i><tt class="parameter">html_errors</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
Turn off HTML tags in error messages. The new format for HTML errors
produces clickable messages that direct the user to a page describing
the error or function in causing the error. These references are
affected by
<a href="errorfunc.configuration.php#ini.docref-root" class="link">docref_root</a> and
<a href="errorfunc.configuration.php#ini.docref-ext" class="link">docref_ext</a>.
</p>
</dd>
</dt>
<dt id="ini.xmlrpc-errors">
<span class="term">
<i><tt class="parameter">xmlrpc_errors</tt></i>
<span class="type"><a href="language.types.boolean.php" class="type boolean">boolean</a></span>
</span>
<dd>
<p class="para">
Turns off normal error reporting and formats errors as XML-RPC error message.
</p>
</dd>
</dt>
<dt id="ini.xmlrpc-error-number">
<span class="term">
<i><tt class="parameter">xmlrpc_error_number</tt></i>
<span class="type"><a href="language.types.integer.php" class="type integer">integer</a></span>
</span>
<dd>
<p class="para">
Used as the value of the XML-RPC faultCode element.
</p>
</dd>
</dt>
<dt id="ini.docref-root">
<span class="term">
<i><tt class="parameter">docref_root</tt></i>
<span class="type"><a href="language.types.string.php" class="type string">string</a></span>
</span>
<dd>
<p class="para">
The new error format contains a reference to a page describing the error or
function causing the error. In case of manual pages you can download the
manual in your language and set this ini directive to the URL of your local
copy. If your local copy of the manual can be reached by <i>"/manual/"</i>
you can simply use <strong class="userinput"><code>docref_root=/manual/</code></strong>. Additional you have
to set docref_ext to match the fileextensions of your copy
<strong class="userinput"><code>docref_ext=.html</code></strong>. It is possible to use external
references. For example you can use
<strong class="userinput"><code>docref_root=http://manual/en/</code></strong> or
<strong class="userinput"><code>docref_root="http://landonize.it/?how=url&theme=classic&filter=Landon
&url=http%3A%2F%2Fwww.php.net%2F"</code></strong>
</p>
<p class="para">
Most of the time you want the docref_root value to end with a slash <i>"/"</i>.
But see the second example above which does not have nor need it.
</p>
<blockquote class="note"><p><b class="note">Note</b>:
<p class="para">
This is a feature to support your development since it makes it easy to
lookup a function description. However it should never be used on
production systems (e.g. systems connected to the internet).
</p>
</p></blockquote>
</dd>
</dt>
<dt id="ini.docref-ext">
<span class="term">
<i><tt class="parameter">docref_ext</tt></i>
<span class="type"><a href="language.types.string.php" class="type string">string</a></span>
</span>
<dd>
<p class="para">
See <a href="errorfunc.configuration.php#ini.docref-root" class="link">docref_root</a>.
</p>
<blockquote class="note"><p><b class="note">Note</b>:
<p class="para">
The value of docref_ext must begin with a dot <i>"."</i>.
</p>
</p></blockquote>
</dd>
</dt>
<dt id="ini.error-prepend-string">
<span class="term">
<i><tt class="parameter">error_prepend_string</tt></i>
<span class="type"><a href="language.types.string.php" class="type string">string</a></span>
</span>
<dd>
<p class="para">
String to output before an error message.
</p>
</dd>
</dt>
<dt id="ini.error-append-string">
<span class="term">
<i><tt class="parameter">error_append_string</tt></i>
<span class="type"><a href="language.types.string.php" class="type string">string</a></span>
</span>
<dd>
<p class="para">
String to output after an error message.
</p>
</dd>
</dt>
<dt id="ini.error-log">
<span class="term">
<i><tt class="parameter">error_log</tt></i>
<span class="type"><a href="language.types.string.php" class="type string">string</a></span>
</span>
<dd>
<p class="para">
Name of the file where script errors should be logged. The file should
be writable by the web server's user. If the
special value <i>syslog</i> is used, the errors
are sent to the system logger instead. On Unix, this means
syslog(3) and on Windows NT it means the event log. The
system logger is not supported on Windows 95. See also:
<span class="function"><a href="function.syslog.php" class="function">syslog()</a></span>.
If this directive is not set, errors are sent to the SAPI error logger.
For example, it is an error log in Apache or <i>stderr</i>
in CLI.
</p>
</dd>
</dt>
</dl>
</p>
</div><?php manual_footer(); ?>