<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Description of core php.ini directives</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ini.sections.html">List of php.ini sections</a></div> <div class="next" style="text-align: right; float: right;"><a href="extensions.html">Extension List/Categorization</a></div> <div class="up"><a href="ini.html">php.ini directives</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="ini.core" class="section"> <h2 class="title">Description of core <var class="filename">php.ini</var> directives</h2> <p class="para"> This list includes the core <var class="filename">php.ini</var> directives you can set to configure your PHP setup. Directives handled by extensions are listed and detailed at the extension documentation pages respectively; Information on the session directives for example can be found at the <a href="session.configuration.html" class="link">sessions page</a>. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> The defaults listed here are used when <var class="filename">php.ini</var> is not loaded; the values for the production and development <var class="filename">php.ini</var> may vary. </p> </p></blockquote> <div class="section" id="ini.sect.httpd-options"> <h2 class="title">Httpd Options</h2> <p class="para"> <table class="doctable table"> <caption><strong>Httpd Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td>async_send</td> <td>"0"</td> <td>PHP_INI_ALL</td> <td class="empty"> </td> </tr> </tbody> </table> </p> <p class="para"> </p> </div> <div class="section" id="ini.sect.language-options"> <h2 class="title">Language Options</h2> <p class="para"> <table class="doctable table"> <caption><strong>Language and Misc Configuration Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.short-open-tag" class="link">short_open_tag</a></td> <td>"1"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP 4.0.0. PHP_INI_PERDIR in PHP >= 4.0.1.</td> </tr> <tr> <td><a href="ini.core.html#ini.asp-tags" class="link">asp_tags</a></td> <td>"0"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP 4.0.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.precision" class="link">precision</a></td> <td>"14"</td> <td>PHP_INI_ALL</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.serialize-precision" class="link">serialize_precision</a></td> <td>"17"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 4.3.2. Until PHP 5.3.5, the default value was 100.</td> </tr> <tr> <td><a href="ini.core.html#ini.y2k-compliance" class="link">y2k_compliance</a></td> <td>"1"</td> <td>PHP_INI_ALL</td> <td>Removed in PHP 5.4.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.allow-call-time-pass-reference" class="link">allow_call_time_pass_reference</a></td> <td>"1"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP 4.0.0. Removed in PHP 5.4.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.disable-functions" class="link">disable_functions</a></td> <td>""</td> <td>PHP_INI_SYSTEM only</td> <td>Available since PHP 4.0.1.</td> </tr> <tr> <td><a href="ini.core.html#ini.disable-classes" class="link">disable_classes</a></td> <td>""</td> <td><var class="filename">php.ini</var> only</td> <td>Available since PHP 4.3.2.</td> </tr> <tr> <td><a href="ini.core.html#ini.exit-on-timeout" class="link">exit_on_timeout</a></td> <td>""</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.3.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.expose-php" class="link">expose_php</a></td> <td>"1"</td> <td><var class="filename">php.ini</var> only</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.zend.multibyte" class="link">zend.multibyte</a></td> <td>"0"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.4.0</td> </tr> <tr> <td><a href="ini.core.html#ini.zend.script-encoding" class="link">zend.script_encoding</a></td> <td>NULL</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.4.0</td> </tr> <tr> <td><a href="ini.core.html#ini.zend.signal-check" class="link">zend.signal_check</a></td> <td>"0"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.4.0</td> </tr> <tr> <td><a href="ini.core.html#ini.zend.ze1-compatibility-mode" class="link">zend.ze1_compatibility_mode</a></td> <td>"0"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.0.0. Removed in PHP 5.3.0</td> </tr> <tr> <td><a href="ini.core.html#ini.detect-unicode" class="link">detect_unicode</a></td> <td>"1"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.1.0. This deprecated feature <em class="emphasis">will</em> certainly be <em class="emphasis">removed</em> in the future.</td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.short-open-tag"> <span class="term"> <em><code class="parameter">short_open_tag</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Tells PHP whether the short form (<strong class="userinput"><code><? ?></code></strong>) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use <strong class="userinput"><code><?xml ?></code></strong> inline. Otherwise, you can print it with PHP, for example: <strong class="userinput"><code><?php echo '<?xml version="1.0"?>'; ?></code></strong>. Also, if disabled, you must use the long form of the PHP open tag (<strong class="userinput"><code><?php ?></code></strong>). </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This directive also affected the shorthand <strong class="userinput"><code><?=</code></strong> before PHP 5.4.0, which is identical to <strong class="userinput"><code><? echo</code></strong>. Use of this shortcut required <code class="systemitem systemitem">short_open_tag</code> to be on. Since PHP 5.4.0, <strong class="userinput"><code><?=</code></strong> is always available. </p> </p></blockquote> </dd> </dt> <dt id="ini.asp-tags"> <span class="term"> <em><code class="parameter">asp_tags</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <span class="simpara"> Enables the use of ASP-like <% %> tags in addition to the usual <?php ?> tags. This includes the variable-value printing shorthand of <%= $value %>. For more information, see <a href="language.basic-syntax.phpmode.html" class="link">Escaping from HTML</a>. </span> </dd> </dt> <dt id="ini.precision"> <span class="term"> <em><code class="parameter">precision</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <span class="simpara"> The number of significant digits displayed in floating point numbers. </span> </dd> </dt> <dt id="ini.serialize-precision"> <span class="term"> <em><code class="parameter">serialize_precision</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <span class="simpara"> The number of significant digits stored while serializing floating point numbers. </span> </dd> </dt> <dt id="ini.y2k-compliance"> <span class="term"> <em><code class="parameter">y2k_compliance</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <span class="simpara"> Enforce year 2000 compliance (will cause problems with non-compliant browsers) </span> </dd> </dt> <dt id="ini.allow-call-time-pass-reference"> <span class="term"> <em><code class="parameter">allow_call_time_pass_reference</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Whether to warn when arguments are passed by reference at function call time. The encouraged method of specifying which arguments should be passed by reference is in the function declaration. You're encouraged to try and turn this option Off and make sure your scripts work properly with it in order to ensure they will work with future versions of the language (you will receive a warning each time you use this feature). </p> <p class="para"> Passing arguments by reference at function call time was deprecated for code-cleanliness reasons. A function can modify its arguments in an undocumented way if it didn't declare that the argument shall be passed by reference. To prevent side-effects it's better to specify which arguments are passed by reference in the function declaration only. </p> <p class="para"> See also <a href="language.references.html" class="link">References Explained</a>. </p> <p class="para"> <table class="doctable table"> <caption><strong>Changelog for <em>allow_call_time_pass_reference</em></strong></caption> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>5.4.0</td> <td> Removed from PHP. </td> </tr> <tr> <td>5.3.0</td> <td> Emits an <strong><code>E_DEPRECATED</code></strong> level error. </td> </tr> <tr> <td>5.0.0</td> <td> Deprecated, and generates an <strong><code>E_COMPILE_WARNING</code></strong> level error. </td> </tr> </tbody> </table> </p> </dd> </dt> <dt id="ini.expose-php"> <span class="term"> <em><code class="parameter">expose_php</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Exposes to the world that PHP is installed on the server, which includes the PHP version within the HTTP header (e.g., X-Powered-By: PHP/5.3.7). Prior to PHP 5.5.0 the PHP logo guids are also exposed, thus appending them to the URL of your PHP script would display the appropriate logo (e.g., <a href="http://www.php.net/?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" class="link external">» http://www.php.net/?=PHPE9568F34-D428-11d2-A769-00AA001ACF42</a>). This also affected the output of <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span>, as when disabled, the PHP logo and credits information would not be displayed. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Since PHP 5.5.0 these guids and the <span class="function"><a href="function.php-logo-guid.html" class="function">php_logo_guid()</a></span> function have been removed from PHP and the guids are replaced with data URIs instead. Thus accessing the PHP logo via appending the guid to the URL no longer works. Similarly, turning <em><code class="parameter">expose_php</code></em> off will not affect seeing the PHP logo in <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span>. </p> </p></blockquote> <p class="para"> See also <span class="function"><a href="function.php-logo-guid.html" class="function">php_logo_guid()</a></span> and <span class="function"><a href="function.phpcredits.html" class="function">phpcredits()</a></span>. </p> </dd> </dt> <dt id="ini.disable-functions"> <span class="term"> <em><code class="parameter">disable_functions</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> This directive allows you to disable certain functions for <a href="security.html" class="link">security</a> reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">Safe Mode</a>. </p> <p class="para"> Only <a href="functions.internal.html" class="link">internal functions</a> can be disabled using this directive. <a href="functions.user-defined.html" class="link">User-defined functions</a> are unaffected. </p> <p class="para"> This directive must be set in <var class="filename">php.ini</var> For example, you cannot set this in <var class="filename">httpd.conf</var>. </p> </dd> </dt> <dt id="ini.disable-classes"> <span class="term"> <em><code class="parameter">disable_classes</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <span class="simpara"> This directive allows you to disable certain classes for <a href="security.html" class="link">security</a> reasons. It takes on a comma-delimited list of class names. disable_classes is not affected by <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">Safe Mode</a>. </span> <span class="simpara"> This directive must be set in <var class="filename">php.ini</var> For example, you cannot set this in <var class="filename">httpd.conf</var>. </span> <blockquote class="note"><p><strong class="note">Note</strong>: <strong>Availability note</strong><br /> <span class="simpara"> This directive became available in PHP 4.3.2 </span> </p></blockquote> </dd> </dt> <dt id="ini.zend.ze1-compatibility-mode"> <span class="term"> <em><code class="parameter">zend.ze1_compatibility_mode</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Enable compatibility mode with Zend Engine 1 (PHP 4). It affects the cloning, casting (objects with no properties cast to <strong><code>FALSE</code></strong> or 0), and <a href="language.oop5.object-comparison.html" class="link">comparing of objects</a>. In this mode, objects are passed by value instead of reference by default. </p> <p class="para"> See also the section titled <a href="migration5.html" class="link">Migrating from PHP 4 to PHP 5</a>. </p> <div class="warning"><strong class="warning">Warning</strong> <p class="simpara">This feature has been <em class="emphasis">DEPRECATED</em> and <em class="emphasis">REMOVED</em> as of PHP 5.3.0. </p> </div> </dd> </dt> <dt id="ini.zend.multibyte"> <span class="term"> <em><code class="parameter">zend.multibyte</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Enables parsing of source files in multibyte encodings. </p> </dd> </dt> <dt id="ini.zend.script-encoding"> <span class="term"> <em><code class="parameter">zend.script_encoding</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> This value will be used unless a <a href="control-structures.declare.html#control-structures.declare.encoding" class="link">declare(encoding=...)</a> directive appears at the top of the script. </p> </dd> </dt> <dt id="ini.zend.signal-check"> <span class="term"> <em><code class="parameter">zend.signal_check</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> To check for replaced signal handlers on shutdown. </p> </dd> </dt> <dt id="ini.detect-unicode"> <span class="term"> <em><code class="parameter">detect_unicode</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Check for BOM (Byte Order Mark) and see if the file contains valid multibyte characters. This detection is performed before processing of <span class="function"><a href="function.halt-compiler.html" class="function">__halt_compiler()</a></span>. Available only in Zend Multibyte mode. </p> </dd> </dt> <dt id="ini.exit-on-timeout"> <span class="term"> <em><code class="parameter">exit_on_timeout</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> This is an Apache1 mod_php-only directive that forces an Apache child to exit if a PHP execution timeout occurred. Such a timeout causes an internal longjmp() call in Apache1 which can leave some extensions in an inconsistent state. By terminating the process any outstanding locks or memory will be cleaned up. </p> </dd> </dt> </dl> </p> </div> <div class="section" id="ini.sect.resource-limits"> <h2 class="title">Resource Limits</h2> <p class="para"> <table class="doctable table"> <caption><strong>Resource Limits</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.memory-limit" class="link">memory_limit</a></td> <td>"128M"</td> <td>PHP_INI_ALL</td> <td>"8M" before PHP 5.2.0, "16M" in PHP 5.2.0</td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.memory-limit"> <span class="term"> <em><code class="parameter">memory_limit</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to <em>-1</em>. </p> <p class="para"> Prior to PHP 5.2.1, in order to use this directive it had to be enabled at compile time by using <strong class="option configure">--enable-memory-limit</strong> in the configure line. This compile-time flag was also required to define the functions <span class="function"><a href="function.memory-get-usage.html" class="function">memory_get_usage()</a></span> and <span class="function"><a href="function.memory-get-peak-usage.html" class="function">memory_get_peak_usage()</a></span> prior to 5.2.1. </p> <span class="simpara">When an <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> is used, the value is measured in bytes. Shorthand notation, as described in <a href="faq.using.html#faq.using.shorthandbytes" class="link">this FAQ</a>, may also be used. </span> </dd> </dt> </dl> </p> <p class="para"> See also: <a href="info.configuration.html#ini.max-execution-time" class="link">max_execution_time</a>. </p> </div> <div class="section" id="ini.sect.performance"> <h2 class="title">Performance Tuning</h2> <p class="para"> <table class="doctable table"> <caption><strong>Performance Tuning</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.realpath-cache-size" class="link">realpath_cache_size</a></td> <td>"16K"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.1.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.realpath-cache-ttl" class="link">realpath_cache_ttl</a></td> <td>"120"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.1.0.</td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.realpath-cache-size"> <span class="term"> <em><code class="parameter">realpath_cache_size</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Determines the size of the realpath cache to be used by PHP. This value should be increased on systems where PHP opens many files, to reflect the quantity of the file operations performed. </p> <p class="para"> The size represents the total number of bytes in the path strings stored, plus the size of the data associated with the cache entry. This means that in order to store longer paths in the cache, the cache size must be larger. This value does not directly control the number of distinct paths that can be cached. </p> <p class="para"> The size required for the cache entry data is system dependent. </p> </dd> </dt> <dt id="ini.realpath-cache-ttl"> <span class="term"> <em><code class="parameter">realpath_cache_ttl</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Duration of time (in seconds) for which to cache realpath information for a given file or directory. For systems with rarely changing files, consider increasing the value. </p> </dd> </dt> </dl> </p> </div> <div class="section" id="ini.sect.data-handling"> <h2 class="title">Data Handling</h2> <p class="para"> <table class="doctable table"> <caption><strong>Data Handling Configuration Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.track-vars" class="link">track_vars</a></td> <td>"On"</td> <td>PHP_INI_??</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.arg-separator.output" class="link">arg_separator.output</a></td> <td>"&"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 4.0.5.</td> </tr> <tr> <td><a href="ini.core.html#ini.arg-separator.input" class="link">arg_separator.input</a></td> <td>"&"</td> <td>PHP_INI_PERDIR</td> <td>Available since PHP 4.0.5.</td> </tr> <tr> <td><a href="ini.core.html#ini.variables-order" class="link">variables_order</a></td> <td>"EGPCS"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP <= 5.0.5.</td> </tr> <tr> <td><a href="ini.core.html#ini.request-order" class="link">request_order</a></td> <td>""</td> <td>PHP_INI_PERDIR</td> <td>Available since PHP 5.3.0</td> </tr> <tr> <td><a href="ini.core.html#ini.auto-globals-jit" class="link">auto_globals_jit</a></td> <td>"1"</td> <td>PHP_INI_PERDIR</td> <td>Available since PHP 5.0.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.register-globals" class="link">register_globals</a></td> <td>"0"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP <= 4.2.3. Removed in PHP 5.4.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.register-argc-argv" class="link">register_argc_argv</a></td> <td>"1"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP <= 4.2.3.</td> </tr> <tr> <td><a href="ini.core.html#ini.register-long-arrays" class="link">register_long_arrays</a></td> <td>"1"</td> <td>PHP_INI_PERDIR</td> <td>Available since PHP 5.0.0. Deprecated in PHP 5.3.0. Removed in PHP 5.4.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.enable-post-data-reading" class="link">enable_post_data_reading</a></td> <td>"1"</td> <td>PHP_INI_PERDIR</td> <td>Available since PHP 5.4.0</td> </tr> <tr> <td><a href="ini.core.html#ini.post-max-size" class="link">post_max_size</a></td> <td>"8M"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_SYSTEM in PHP <= 4.2.3. Available since PHP 4.0.3.</td> </tr> <tr> <td><a href="ini.core.html#ini.gpc-order" class="link">gpc_order</a></td> <td>"GPC"</td> <td>PHP_INI_ALL</td> <td>Removed in PHP 5.0.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.auto-prepend-file" class="link">auto_prepend_file</a></td> <td>NULL</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP <= 4.2.3.</td> </tr> <tr> <td><a href="ini.core.html#ini.auto-append-file" class="link">auto_append_file</a></td> <td>NULL</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP <= 4.2.3.</td> </tr> <tr> <td><a href="ini.core.html#ini.default-mimetype" class="link">default_mimetype</a></td> <td>"text/html"</td> <td>PHP_INI_ALL</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.default-charset" class="link">default_charset</a></td> <td>""</td> <td>PHP_INI_ALL</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.always-populate-raw-post-data" class="link">always_populate_raw_post_data</a></td> <td>"0"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP <= 4.2.3. Available since PHP 4.1.0.</td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.track-vars"> <span class="term"> <em><code class="parameter">track_vars</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> If enabled, then Environment, GET, POST, Cookie, and Server variables can be found in the global associative arrays <var class="varname"><var class="varname"><a href="reserved.variables.environment.html" class="classname">$_ENV</a></var></var>, <var class="varname"><var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET</a></var></var>, <var class="varname"><var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var></var>, <var class="varname"><var class="varname"><a href="reserved.variables.cookies.html" class="classname">$_COOKIE</a></var></var>, and <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER</a></var></var>. </p> <p class="para"> Note that as of PHP 4.0.3, <code class="systemitem systemitem">track_vars</code> is always turned on. </p> </dd> </dt> <dt id="ini.arg-separator.output"> <span class="term"> <em><code class="parameter">arg_separator.output</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The separator used in PHP generated URLs to separate arguments. </p> </dd> </dt> <dt id="ini.arg-separator.input"> <span class="term"> <em><code class="parameter">arg_separator.input</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> List of separator(s) used by PHP to parse input URLs into variables. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Every character in this directive is considered as separator! </p> </p></blockquote> </dd> </dt> <dt id="ini.variables-order"> <span class="term"> <em><code class="parameter">variables_order</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Sets the order of the EGPCS (<em>E</em>nvironment, <em>G</em>et, <em>P</em>ost, <em>C</em>ookie, and <em>S</em>erver) variable parsing. For example, if variables_order is set to <em>"SP"</em> then PHP will create the <a href="language.variables.predefined.html" class="link">superglobals</a> <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER</a></var></var> and <var class="varname"><var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var></var>, but not create <var class="varname"><var class="varname"><a href="reserved.variables.environment.html" class="classname">$_ENV</a></var></var>, <var class="varname"><var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET</a></var></var>, and <var class="varname"><var class="varname"><a href="reserved.variables.cookies.html" class="classname">$_COOKIE</a></var></var>. Setting to "" means no <a href="language.variables.predefined.html" class="link">superglobals</a> will be set. </p> <p class="para"> If the deprecated <a href="ini.core.html#ini.register-globals" class="link">register_globals</a> directive is on, then variables_order also configures the order the <em>ENV</em>, <em>GET</em>, <em>POST</em>, <em>COOKIE</em> and <em>SERVER</em> variables are populated in global scope. So for example if variables_order is set to <em>"EGPCS"</em>, register_globals is enabled, and both <var class="varname"><var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET['action']</a></var></var> and <var class="varname"><var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST['action']</a></var></var> are set, then <var class="varname"><var class="varname">$action</var></var> will contain the value of <var class="varname"><var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST['action']</a></var></var> as <em>P</em> comes after <em>G</em> in our example directive value. </p> <div class="warning"><strong class="warning">Warning</strong> <p class="para"> In both the CGI and FastCGI SAPIs, <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER</a></var></var> is also populated by values from the environment; <em>S</em> is always equivalent to <em>ES</em> regardless of the placement of <em>E</em> elsewhere in this directive. </p> </div> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> The content and order of <var class="varname"><var class="varname"><a href="reserved.variables.request.html" class="classname">$_REQUEST</a></var></var> is also affected by this directive. </p> </p></blockquote> </dd> </dt> <dt id="ini.request-order"> <span class="term"> <em><code class="parameter">request_order</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> This directive describes the order in which PHP registers GET, POST and Cookie variables into the _REQUEST array. Registration is done from left to right, newer values override older values. </p> <p class="para"> If this directive is not set, <a href="ini.core.html#ini.variables-order" class="link">variables_order</a> is used for <var class="varname"><var class="varname"><a href="reserved.variables.request.html" class="classname">$_REQUEST</a></var></var> contents. </p> <p class="para"> Note that the default distribution <var class="filename">php.ini</var> files does not contain the <em>'C'</em> for cookies, due to security concerns. </p> </dd> </dt> <dt id="ini.auto-globals-jit"> <span class="term"> <em><code class="parameter">auto_globals_jit</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> When enabled, the SERVER and ENV variables are created when they're first used (Just In Time) instead of when the script starts. If these variables are not used within a script, having this directive on will result in a performance gain. </p> <p class="para"> The PHP directives <a href="ini.core.html#ini.register-globals" class="link">register_globals</a>, <a href="ini.core.html#ini.register-long-arrays" class="link">register_long_arrays</a>, and <a href="ini.core.html#ini.register-argc-argv" class="link">register_argc_argv</a> must be disabled for this directive to have any affect. Since PHP 5.1.3 it is not necessary to have <a href="ini.core.html#ini.register-argc-argv" class="link">register_argc_argv</a> disabled. </p> <div class="warning"><strong class="warning">Warning</strong> <p class="para"> Usage of SERVER and ENV variables is checked during the compile time so using them through e.g. <a href="language.variables.variable.html" class="link">variable variables</a> will not cause their initialization. </p> </div> </dd> </dt> <dt id="ini.register-globals"> <span class="term"> <em><code class="parameter">register_globals</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables. </p> <p class="para"> As of <a href="http://www.php.net/releases/4_2_0.php" class="link external">» PHP 4.2.0</a>, this directive defaults to <em class="emphasis">off</em>. </p> <p class="para"> Please read the security chapter on <a href="security.globals.html" class="link">Using register_globals</a> for related information. </p> <p class="para"> Please note that <code class="systemitem systemitem">register_globals</code> cannot be set at runtime ( <span class="function"><a href="function.ini-set.html" class="function">ini_set()</a></span>). Although, you can use <var class="filename">.htaccess</var> if your host allows it as described above. An example <var class="filename">.htaccess</var> entry: <strong class="userinput"><code>php_flag register_globals off</code></strong>. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> <code class="systemitem systemitem">register_globals</code> is affected by the <a href="ini.core.html#ini.variables-order" class="link">variables_order</a> directive. </p> </p></blockquote> <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This feature has been <em class="emphasis">DEPRECATED</em> as of PHP 5.3.0 and <em class="emphasis">REMOVED</em> as of PHP 5.4.0.</p></div> </dd> </dt> <dt id="ini.register-argc-argv"> <span class="term"> <em><code class="parameter">register_argc_argv</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <span class="simpara"> Tells PHP whether to declare the argv & argc variables (that would contain the GET information). </span> <span class="simpara"> See also <a href="features.commandline.html" class="link">command line</a>. </span> </dd> </dt> <dt id="ini.register-long-arrays"> <span class="term"> <em><code class="parameter">register_long_arrays</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <span class="simpara"> Tells PHP whether or not to register the deprecated long <var class="varname"><var class="varname">$HTTP_*_VARS</var></var> type <a href="language.variables.predefined.html" class="link">predefined variables</a>. When On (default), long predefined PHP variables like <var class="varname"><var class="varname">$HTTP_GET_VARS</var></var> will be defined. If you're not using them, it's recommended to turn them off, for performance reasons. Instead, use the superglobal arrays, like <var class="varname"><var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET</a></var></var>. </span> <span class="simpara"> This directive became available in PHP 5.0.0. </span> <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This feature has been <em class="emphasis">DEPRECATED</em> as of PHP 5.3.0 and <em class="emphasis">REMOVED</em> as of PHP 5.4.0.</p></div> </dd> </dt> <dt id="ini.enable-post-data-reading"> <span class="term"> <em><code class="parameter">enable_post_data_reading</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <span class="simpara"> Disabling this option causes <var class="varname"><var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var></var> and <var class="varname"><var class="varname"><a href="reserved.variables.files.html" class="classname">$_FILES</a></var></var> <em class="emphasis">not</em> to be populated. The only way to read postdata will then be through the <a href="wrappers.php.html" class="link">php://input</a> stream wrapper. This can be useful to proxy requests or to process the POST data in a memory efficient fashion. </span> </dd> </dt> <dt id="ini.post-max-size"> <span class="term"> <em><code class="parameter">post_max_size</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <span class="simpara"> Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than <a href="ini.core.html#ini.upload-max-filesize" class="link">upload_max_filesize</a>. </span> <span class="simpara"> If memory limit is enabled by your configure script, <a href="ini.core.html#ini.memory-limit" class="link">memory_limit</a> also affects file uploading. Generally speaking, <a href="ini.core.html#ini.memory-limit" class="link">memory_limit</a> should be larger than <em><code class="parameter">post_max_size</code></em>. </span> <span class="simpara">When an <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> is used, the value is measured in bytes. Shorthand notation, as described in <a href="faq.using.html#faq.using.shorthandbytes" class="link">this FAQ</a>, may also be used. </span> <span class="simpara"> If the size of post data is greater than post_max_size, the <var class="varname"><var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var></var> and <var class="varname"><var class="varname"><a href="reserved.variables.files.html" class="classname">$_FILES</a></var></var> <a href="language.variables.superglobals.html" class="link">superglobals</a> are empty. This can be tracked in various ways, e.g. by passing the <var class="varname"><var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET</a></var></var> variable to the script processing the data, i.e. <em><form action="edit.php?processed=1"></em>, and then checking if <var class="varname"><var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET['processed']</a></var></var> is set. </span> <p class="para"> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> PHP allows shortcuts for bit values, including K (kilo), M (mega) and G (giga). PHP will do the conversions automatically if you use any of these. Be careful not to exceed the 32 bit signed integer limit (if you're using 32bit versions) as it will cause your script to fail. </p> </p></blockquote> </p> </dd> </dt> <dt id="ini.gpc-order"> <span class="term"> <em><code class="parameter">gpc_order</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Set the order of GET/POST/COOKIE variable parsing. The default setting of this directive is "GPC". Setting this to "GP", for example, will cause PHP to completely ignore cookies and to overwrite any GET method variables with POST-method variables of the same name. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This option was removed in PHP 5.0.0. Use <a href="ini.core.html#ini.variables-order" class="link">variables_order</a> instead. </p> </p></blockquote> </dd> </dt> <dt id="ini.auto-prepend-file"> <span class="term"> <em><code class="parameter">auto_prepend_file</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the <span class="function"><a href="function.require.html" class="function">require</a></span> function, so <a href="ini.core.html#ini.include-path" class="link">include_path</a> is used.</p> <p class="para"> The special value <em>none</em> disables auto-prepending. </p> </dd> </dt> <dt id="ini.auto-append-file"> <span class="term"> <em><code class="parameter">auto_append_file</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Specifies the name of a file that is automatically parsed after the main file. The file is included as if it was called with the <span class="function"><a href="function.require.html" class="function">require</a></span> function, so <a href="ini.core.html#ini.include-path" class="link">include_path</a> is used.</p> <p class="para"> The special value <em>none</em> disables auto-appending. <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara"> If the script is terminated with <span class="function"><a href="function.exit.html" class="function">exit()</a></span>, auto-append will <em class="emphasis">not</em> occur.</span> </p></blockquote> </p> </dd> </dt> <dt id="ini.default-mimetype"> <span class="term"> <em><code class="parameter">default_mimetype</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> </p> </dd> </dt> <dt id="ini.default-charset"> <span class="term"> <em><code class="parameter">default_charset</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> PHP always outputs a character encoding by default in the Content-type: header. To disable sending of the charset, simply set it to be empty. </p> </dd> </dt> <dt id="ini.always-populate-raw-post-data"> <span class="term"> <em><code class="parameter">always_populate_raw_post_data</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Always populate the <var class="varname"><var class="varname"><a href="reserved.variables.httprawpostdata.html" class="classname">$HTTP_RAW_POST_DATA</a></var></var> containing the raw POST data. Otherwise, the variable is populated only with unrecognized MIME type of the data. However, the preferred method for accessing the raw POST data is <a href="wrappers.php.html" class="link">php://input</a>. <var class="varname"><var class="varname"><a href="reserved.variables.httprawpostdata.html" class="classname">$HTTP_RAW_POST_DATA</a></var></var> is not available with <em>enctype="multipart/form-data"</em>. </p> </dd> </dt> </dl> </p> <p class="para"> See also: <a href="info.configuration.html#ini.magic-quotes-gpc" class="link">magic_quotes_gpc</a>, <a href="info.configuration.html#ini.magic-quotes-runtime" class="link">magic_quotes_runtime</a>, and <a href="sybase.configuration.html#ini.magic-quotes-sybase" class="link">magic_quotes_sybase</a>. </p> </div> <div class="section" id="ini.sect.path-directory"> <h2 class="title">Paths and Directories</h2> <p class="para"> <table class="doctable table"> <caption><strong>Paths and Directories Configuration Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.include-path" class="link">include_path</a></td> <td>".;/path/to/php/pear"</td> <td>PHP_INI_ALL</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.open-basedir" class="link">open_basedir</a></td> <td>NULL</td> <td>PHP_INI_ALL</td> <td>PHP_INI_SYSTEM in PHP < 5.3.0</td> </tr> <tr> <td><a href="ini.core.html#ini.doc-root" class="link">doc_root</a></td> <td>NULL</td> <td>PHP_INI_SYSTEM</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.user-dir" class="link">user_dir</a></td> <td>NULL</td> <td>PHP_INI_SYSTEM</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.extension-dir" class="link">extension_dir</a></td> <td>"/path/to/php"</td> <td>PHP_INI_SYSTEM</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.extension" class="link">extension</a></td> <td>NULL</td> <td><var class="filename">php.ini</var> only</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.zend-extension" class="link">zend_extension</a></td> <td>NULL</td> <td><var class="filename">php.ini</var> only</td> <td class="empty"> </td> </tr> <tr> <td><a href="ini.core.html#ini.zend-extension-debug" class="link">zend_extension_debug</a></td> <td>NULL</td> <td><var class="filename">php.ini</var> only</td> <td>Available before PHP 5.3.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.zend-extension-debug-ts" class="link">zend_extension_debug_ts</a></td> <td>NULL</td> <td><var class="filename">php.ini</var> only</td> <td>Available before PHP 5.3.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.zend-extension-ts" class="link">zend_extension_ts</a></td> <td>NULL</td> <td><var class="filename">php.ini</var> only</td> <td>Available before PHP 5.3.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.cgi.check-shebang-line" class="link">cgi.check_shebang_line</a></td> <td>"1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.2.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.cgi.fix-pathinfo" class="link">cgi.fix_pathinfo</a></td> <td>"1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 4.3.0. PHP_INI_ALL prior to PHP 5.2.1.</td> </tr> <tr> <td><a href="ini.core.html#ini.cgi.force-redirect" class="link">cgi.force_redirect</a></td> <td>"1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 4.2.0. PHP_INI_ALL prior to PHP 5.2.1.</td> </tr> <tr> <td><a href="ini.core.html#ini.cgi.redirect-status-env" class="link">cgi.redirect_status_env</a></td> <td>NULL</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 4.2.0. PHP_INI_ALL prior to PHP 5.2.1.</td> </tr> <tr> <td><a href="ini.core.html#ini.cgi.rfc2616-headers" class="link">cgi.rfc2616_headers</a></td> <td>"0"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 4.3.0.</td> </tr> <tr> <td><a href="ini.core.html#ini.fastcgi.impersonate" class="link">fastcgi.impersonate</a></td> <td>"0"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 4.3.0. PHP_INI_ALL prior to PHP 5.2.1.</td> </tr> <tr> <td><a href="ini.core.html#ini.fastcgi.logging" class="link">fastcgi.logging</a></td> <td>"1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 4.3.0. PHP_INI_ALL prior to PHP 5.2.1.</td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.include-path"> <span class="term"> <em><code class="parameter">include_path</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Specifies a list of directories where the <span class="function"><a href="function.require.html" class="function">require</a></span>, <span class="function"><a href="function.include.html" class="function">include</a></span>, <span class="function"><a href="function.fopen.html" class="function">fopen()</a></span>, <span class="function"><a href="function.file.html" class="function">file()</a></span>, <span class="function"><a href="function.readfile.html" class="function">readfile()</a></span> and <span class="function"><a href="function.file-get-contents.html" class="function">file_get_contents()</a></span> functions look for files. The format is like the system's <span class="envar">PATH</span> environment variable: a list of directories separated with a colon in Unix or semicolon in Windows. </p> <p class="para"> PHP considers each entry in the include path separately when looking for files to include. It will check the first path, and if it doesn't find it, check the next path, until it either locates the included file or returns with a <a href="" class="link">warning</a> or an <a href="" class="link">error</a>. You may modify or set your include path at runtime using <span class="function"><a href="function.set-include-path.html" class="function">set_include_path()</a></span>. </p> <p class="para"> <div class="example" id="example-5627"> <p><strong>Example #1 Unix include_path</strong></p> <div class="example-contents"> <div class="php.inicode"><pre class="php.inicode">include_path=".:/php/includes"</pre> </div> </div> </div> </p> <p class="para"> <div class="example" id="example-5628"> <p><strong>Example #2 Windows include_path</strong></p> <div class="example-contents"> <div class="php.inicode"><pre class="php.inicode">include_path=".;c:\php\includes"</pre> </div> </div> </div> </p> <p class="para"> Using a <em>.</em> in the include path allows for relative includes as it means the current directory. However, it is more efficient to explicitly use <em>include './file'</em> than having PHP always check the current directory for every include. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> <em>ENV</em> variables are also accessible in .ini files. As such it is possible to reference the home directory using <em>${LOGIN}</em> and <em>${USER}</em>. </p> <p class="para"> Environment variables may vary between Server APIs as those environments may be different. </p> </p></blockquote> <p class="para"> <div class="example" id="example-5629"> <p><strong>Example #3 Unix include_path using ${USER} env variable</strong></p> <div class="example-contents"> <div class="php.inicode"><pre class="php.inicode">include_path = ".:${USER}/pear/php"</pre> </div> </div> </div> </p> </dd> </dt> <dt id="ini.open-basedir"> <span class="term"> <em><code class="parameter">open_basedir</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Limit the files that can be accessed by PHP to the specified directory-tree, including the file itself. This directive is <em class="emphasis">NOT</em> affected by whether Safe Mode is turned On or Off. </p> <p class="para"> When a script tries to access the filesystem, for example using <span class="function"><a href="function.include.html" class="function">include</a></span>, or <span class="function"><a href="function.fopen.html" class="function">fopen()</a></span>, the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to access it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink. If the file doesn't exist then the symlink couldn't be resolved and the filename is compared to (a resolved) <strong class="option unknown">open_basedir</strong> . </p> <p class="para"> <strong class="option unknown">open_basedir</strong> can affect more than just filesystem functions; for example if <em>MySQL</em> is configured to use <em>mysqlnd</em> drivers, <em>LOAD DATA INFILE</em> will be affected by <strong class="option unknown">open_basedir</strong> . Much of the extended functionality of PHP uses <em>open_basedir</em> in this way. </p> <p class="para"> The special value <code class="systemitem systemitem">.</code> indicates that the working directory of the script will be used as the base-directory. This is, however, a little dangerous as the working directory of the script can easily be changed with <span class="function"><a href="function.chdir.html" class="function">chdir()</a></span>. </p> <p class="para"> In <var class="filename">httpd.conf</var>, <strong class="option unknown">open_basedir</strong> can be turned off (e.g. for some virtual hosts) <a href="configuration.changes.html#configuration.changes.apache" class="link">the same way</a> as any other configuration directive with "<em>php_admin_value open_basedir none</em>". </p> <p class="para"> Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon. As an Apache module, <strong class="option unknown">open_basedir</strong> paths from parent directories are now automatically inherited. </p> <p class="para"> The restriction specified with <strong class="option unknown">open_basedir</strong> is a directory name since PHP 5.2.16 and 5.3.4. Previous versions used it as a prefix. This means that "<em>open_basedir = /dir/incl</em>" also allowed access to "<em>/dir/include</em>" and "<em>/dir/incls</em>" if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: <em>open_basedir = /dir/incl/</em> </p> <p class="para"> The default is to allow all files to be opened. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> As of PHP 5.3.0 open_basedir can be tightened at run-time. This means that if open_basedir is set to <em>/www/</em> in <var class="filename">php.ini</var> a script can tighten the configuration to <em>/www/tmp/</em> at run-time with <span class="function"><a href="function.ini-set.html" class="function">ini_set()</a></span>. When listing several directories, you can use the <strong><code>PATH_SEPARATOR</code></strong> constant as a separator regardless of the operating system. </p> </p></blockquote> </dd> </dt> <dt id="ini.doc-root"> <span class="term"> <em><code class="parameter">doc_root</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> PHP's "root directory" on the server. Only used if non-empty. If PHP is configured with <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">safe mode</a>, no files outside this directory are served. If PHP was not compiled with FORCE_REDIRECT, you <em class="emphasis">should </em> set doc_root if you are running PHP as a CGI under any web server (other than IIS). The alternative is to use the <a href="ini.core.html#ini.cgi.force-redirect" class="link"> cgi.force_redirect</a> configuration below. </p> </dd> </dt> <dt id="ini.user-dir"> <span class="term"> <em><code class="parameter">user_dir</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The base name of the directory used on a user's home directory for PHP files, for example <var class="filename">public_html </var>. </p> </dd> </dt> <dt id="ini.extension-dir"> <span class="term"> <em><code class="parameter">extension_dir</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> In what directory PHP should look for dynamically loadable extensions. See also: <a href="info.configuration.html#ini.enable-dl" class="link">enable_dl</a>, and <span class="function"><a href="function.dl.html" class="function">dl()</a></span>. </p> </dd> </dt> <dt id="ini.extension"> <span class="term"> <em><code class="parameter">extension</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Which dynamically loadable extensions to load when PHP starts up. </p> </dd> </dt> <dt id="ini.zend-extension"> <span class="term"> <em><code class="parameter">zend_extension</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Absolute path to dynamically loadable Zend extension (for example <a href="book.apd.html" class="link">APD</a>) to load when PHP starts up. </p> </dd> </dt> <dt id="ini.zend-extension-debug"> <span class="term"> <em><code class="parameter">zend_extension_debug</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Variant of <a href="ini.core.html#ini.zend-extension" class="link">zend_extension</a> for extensions compiled with debug info prior to PHP 5.3.0. </p> </dd> </dt> <dt id="ini.zend-extension-debug-ts"> <span class="term"> <em><code class="parameter">zend_extension_debug_ts</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Variant of <a href="ini.core.html#ini.zend-extension" class="link">zend_extension</a> for extensions compiled with debug info and thread safety prior to PHP 5.3.0. </p> </dd> </dt> <dt id="ini.zend-extension-ts"> <span class="term"> <em><code class="parameter">zend_extension_ts</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> Variant of <a href="ini.core.html#ini.zend-extension" class="link">zend_extension</a> for extensions compiled with thread safety prior to PHP 5.3.0. </p> </dd> </dt> <dt id="ini.cgi.check-shebang-line"> <span class="term"> <em><code class="parameter">cgi.check_shebang_line</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Controls whether <acronym title="Common Gateway Interface">CGI</acronym> PHP checks for line starting with <em>#!</em> (shebang) at the top of the running script. This line might be needed if the script support running both as stand-alone script and via PHP <acronym title="Common Gateway Interface">CGI</acronym>. PHP in <acronym title="Common Gateway Interface">CGI</acronym> mode skips this line and ignores its content if this directive is turned on. </p> </dd> </dt> <dt id="ini.cgi.fix-pathinfo"> <span class="term"> <em><code class="parameter">cgi.fix_pathinfo</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Provides <em class="emphasis">real</em> <em>PATH_INFO</em>/ <em>PATH_TRANSLATED</em> support for <acronym title="Common Gateway Interface">CGI</acronym>. PHP's previous behaviour was to set <em>PATH_TRANSLATED</em> to <em>SCRIPT_FILENAME</em>, and to not grok what <em> PATH_INFO</em> is. For more information on <em>PATH_INFO</em>, see the <acronym title="Common Gateway Interface">CGI</acronym> specs. Setting this to <em>1</em> will cause PHP <acronym title="Common Gateway Interface">CGI</acronym> to fix its paths to conform to the spec. A setting of zero causes PHP to behave as before. It is turned on by default. You should fix your scripts to use <em>SCRIPT_FILENAME</em> rather than <em>PATH_TRANSLATED</em>. </p> </dd> </dt> <dt id="ini.cgi.force-redirect"> <span class="term"> <em><code class="parameter">cgi.force_redirect</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> cgi.force_redirect is necessary to provide security running PHP as a <acronym title="Common Gateway Interface">CGI</acronym> under most web servers. Left undefined, PHP turns this on by default. You can turn it off <em class="emphasis">at your own risk</em>. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Windows Users: When using IIS this option <em class="emphasis">must</em> be turned off. For OmniHTTPD or Xitami the same applies. </p> </p></blockquote> </dd> </dt> <dt id="ini.cgi.redirect-status-env"> <span class="term"> <em><code class="parameter">cgi.redirect_status_env</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> If cgi.force_redirect is turned on, and you are not running under Apache or Netscape (iPlanet) web servers, you <em class="emphasis">may</em> need to set an environment variable name that PHP will look for to know it is OK to continue execution. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Setting this variable <em class="emphasis">may</em> cause security issues, <em class="emphasis">know what you are doing first</em>. </p> </p></blockquote> </dd> </dt> <dt id="ini.cgi.rfc2616-headers"> <span class="term"> <em><code class="parameter">cgi.rfc2616_headers</code></em> <span class="type"><a href="language.types.integer.html" class="type int">int</a></span> </span> <dd> <p class="para"> Tells PHP what type of headers to use when sending HTTP response code. If it's set to 0, PHP sends a <a href="http://www.faqs.org/rfcs/rfc3875" class="link external">» RFC 3875</a> "Status:" header that is supported by Apache and other web servers. When this option is set to 1, PHP will send <a href="http://www.faqs.org/rfcs/rfc2616" class="link external">» RFC 2616</a> compliant headers. </p> <p class="para"> If this option is enabled, and you are running PHP in a CGI environment (e.g. PHP-FPM) you should not use standard RFC 2616 style HTTP status response headers, you should instead use their RFC 3875 equivalent e.g. instead of header("HTTP/1.0 404 Not found"); you should use header("Status: 404 Not Found"); </p> <p class="para"> Leave it set to 0 unless you know what you're doing. </p> </dd> </dt> <dt id="ini.fastcgi.impersonate"> <span class="term"> <em><code class="parameter">fastcgi.impersonate</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> FastCGI under IIS (on WINNT based OS) supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under. mod_fastcgi under Apache does not currently support this feature (03/17/2002) Set to 1 if running under IIS. Default is zero. </p> </dd> </dt> <dt id="ini.fastcgi.logging"> <span class="term"> <em><code class="parameter">fastcgi.logging</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Turns on SAPI logging when using FastCGI. Default is to enable logging. </p> </dd> </dt> </dl> </p> </div> <div class="section" id="ini.sect.file-uploads"> <h2 class="title">File Uploads</h2> <p class="para"> <table class="doctable table"> <caption><strong>File Uploads Configuration Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.file-uploads" class="link">file_uploads</a></td> <td>"1"</td> <td>PHP_INI_SYSTEM</td> <td>PHP_INI_ALL in PHP <= 4.2.3. Available since PHP 4.0.3.</td> </tr> <tr> <td><a href="ini.core.html#ini.upload-tmp-dir" class="link">upload_tmp_dir</a></td> <td>NULL</td> <td>PHP_INI_SYSTEM</td> <td class="empty"> </td> </tr> <tr> <td><a href="info.configuration.html#ini.max-input-nesting-level" class="link">max_input_nesting_level</a></td> <td>64</td> <td>PHP_INI_PERDIR</td> <td>Available since PHP 5.3.9.</td> </tr> <tr> <td><a href="info.configuration.html#ini.max-input-vars" class="link">max_input_vars</a></td> <td>1000</td> <td>PHP_INI_PERDIR</td> <td>Available since PHP 5.3.9.</td> </tr> <tr> <td><a href="ini.core.html#ini.upload-max-filesize" class="link">upload_max_filesize</a></td> <td>"2M"</td> <td>PHP_INI_PERDIR</td> <td>PHP_INI_ALL in PHP <= 4.2.3.</td> </tr> <tr> <td><a href="ini.core.html#ini.max-file-uploads" class="link">max_file_uploads</a></td> <td>20</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.2.12.</td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.file-uploads"> <span class="term"> <em><code class="parameter">file_uploads</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> Whether or not to allow HTTP <a href="features.file-upload.html" class="link">file uploads</a>. See also the <a href="ini.core.html#ini.upload-max-filesize" class="link">upload_max_filesize</a>, <a href="ini.core.html#ini.upload-tmp-dir" class="link">upload_tmp_dir</a>, and <a href="ini.core.html#ini.post-max-size" class="link">post_max_size</a> directives. </p> </dd> </dt> <dt id="ini.upload-tmp-dir"> <span class="term"> <em><code class="parameter">upload_tmp_dir</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The temporary directory used for storing files when doing file upload. Must be writable by whatever user PHP is running as. If not specified PHP will use the system's default. </p> <p class="para"> If the directory specified here is not writable, PHP falls back to the system default temporary directory. If <a href="ini.core.html#ini.open-basedir" class="link">open_basedir</a> is on, then the system default directory must be allowed for an upload to succeed. </p> </dd> </dt> <dt id="ini.upload-max-filesize"> <span class="term"> <em><code class="parameter">upload_max_filesize</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> The maximum size of an uploaded file. </p> <span class="simpara">When an <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> is used, the value is measured in bytes. Shorthand notation, as described in <a href="faq.using.html#faq.using.shorthandbytes" class="link">this FAQ</a>, may also be used. </span> </dd> </dt> <dt id="ini.max-file-uploads"> <span class="term"> <em><code class="parameter">max_file_uploads</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> The maximum number of files allowed to be uploaded simultaneously. Starting with PHP 5.3.4, upload fields left blank on submission do not count towards this limit. </p> </dd> </dt> </dl> </p> </div> <div class="section" id="ini.sect.sql-general"> <h2 class="title">General SQL</h2> <p class="para"> <table class="doctable table"> <caption><strong>General SQL Configuration Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.sql.safe-mode" class="link">sql.safe_mode</a></td> <td>"0"</td> <td>PHP_INI_SYSTEM</td> <td class="empty"> </td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.sql.safe-mode"> <span class="term"> <em><code class="parameter">sql.safe_mode</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> If turned on, database connect functions that specify default values will use those values in place of supplied arguments. For default values see connect function documentation for the relevant database. </p> </dd> </dt> </dl> </p> </div> <div class="section" id="ini.sect.windows"> <h2 class="title">Windows Specific</h2> <p class="para"> <table class="doctable table"> <caption><strong>Windows Specific Configuration Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="ini.core.html#ini.windows-show-crt-warning" class="link">windows_show_crt_warning</a></td> <td>"0"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.4.0.</td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.windows-show-crt-warning"> <span class="term"> <em><code class="parameter">windows_show_crt_warning</code></em> <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> </span> <dd> <p class="para"> This directive shows the Windows CRT warnings when enabled. These warnings were displayed by default until PHP 5.4.0. </p> </dd> </dt> </dl> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ini.sections.html">List of php.ini sections</a></div> <div class="next" style="text-align: right; float: right;"><a href="extensions.html">Extension List/Categorization</a></div> <div class="up"><a href="ini.html">php.ini directives</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>