<!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>.user.ini files</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="configuration.file.html">The configuration file</a></div> <div class="next" style="text-align: right; float: right;"><a href="configuration.changes.modes.html">Where a configuration setting may be set</a></div> <div class="up"><a href="configuration.html">Runtime Configuration</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="configuration.file.per-user" class="sect1"> <h2 class="title">.user.ini files</h2> <p class="simpara"> Since PHP 5.3.0, PHP includes support for configuration INI files on a per-directory basis. These files are processed <em class="emphasis">only</em> by the CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner extension. If you are using Apache, use <var class="filename">.htaccess</var> files for the same effect. </p> <p class="simpara"> In addition to the main <var class="filename">php.ini</var> file, PHP scans for INI files in each directory, starting with the directory of the requested PHP file, and working its way up to the current document root (as set in <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER['DOCUMENT_ROOT']</a></var></var>). In case the PHP file is outside the document root, only its directory is scanned. </p> <p class="simpara"> Only INI settings with the modes <strong><code>PHP_INI_PERDIR</code></strong> and <strong><code>PHP_INI_USER</code></strong> will be recognized in .user.ini-style INI files. </p> <p class="simpara"> Two new INI directives, <em>user_ini.filename</em> and <em>user_ini.cache_ttl</em> control the use of user INI files. </p> <p class="simpara"> <em>user_ini.filename</em> sets the name of the file PHP looks for in each directory; if set to an empty string, PHP doesn't scan at all. The default is <em>.user.ini</em>. </p> <p class="simpara"> <em>user_ini.cache_ttl</em> controls how often user INI files are re-read. The default is 300 seconds (5 minutes). </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="configuration.file.html">The configuration file</a></div> <div class="next" style="text-align: right; float: right;"><a href="configuration.changes.modes.html">Where a configuration setting may be set</a></div> <div class="up"><a href="configuration.html">Runtime Configuration</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>