⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configuration.changes.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>How to change configuration settings</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="configuration.html">Runtime Configuration</a></div> <div class="next" style="text-align: right; float: right;"><a href="langref.html">Language Reference</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.changes" class="sect1">   <h2 class="title">How to change configuration settings</h2>   <div id="configuration.changes.apache" class="sect2">    <h3 class="title">Running PHP as an Apache module</h3>    <p class="simpara">     When using PHP as an Apache module, you can also change the     configuration settings using directives in Apache configuration     files (e.g. <var class="filename">httpd.conf</var>) and <var class="filename">.htaccess</var> files. You will need     &quot;AllowOverride Options&quot; or &quot;AllowOverride All&quot; privileges to do so.    </p>    <p class="para">     There are several Apache directives that allow you     to change the PHP configuration from within the Apache configuration     files.  For a listing of which directives are      <b><tt>PHP_INI_ALL</tt></b>, <b><tt>PHP_INI_PERDIR</tt></b>,      or <b><tt>PHP_INI_SYSTEM</tt></b>, have a look at the     <a href="ini.html#ini.list" class="link">List of php.ini directives</a> appendix.    </p>    <p class="para">     <dl>      <dt>       <span class="term">        <code class="systemitem systemitem">php_value</code>        <i><tt class="parameter">name</tt></i>        <i><tt class="parameter">value</tt></i>       </span>       <dd>        <p class="para">         Sets the value of the specified directive.         Can be used only with <b><tt>PHP_INI_ALL</tt></b> and <b><tt>PHP_INI_PERDIR</tt></b> type directives.         To clear a previously set value use <i>none</i> as the value.        </p>        <blockquote><p><b class="note">Note</b>:          <span class="simpara">          Don&#039;t use <code class="systemitem systemitem">php_value</code> to set boolean values.          <code class="systemitem systemitem">php_flag</code> (see below) should be used instead.         </span>        </p></blockquote>       </dd>      </dt>      <dt>       <span class="term">        <code class="systemitem systemitem">php_flag</code>        <i><tt class="parameter">name</tt></i>        <i><tt class="parameter">on|off</tt></i>       </span>       <dd>        <p class="para">         Used to set a boolean configuration directive.         Can be used only with <b><tt>PHP_INI_ALL</tt></b> and         <b><tt>PHP_INI_PERDIR</tt></b> type directives.        </p>       </dd>      </dt>      <dt>       <span class="term">        <code class="systemitem systemitem">php_admin_value</code>        <i><tt class="parameter">name</tt></i>        <i><tt class="parameter">value</tt></i>       </span>       <dd>        <p class="para">         Sets the value of the specified directive.         This <em class="emphasis">can not be used</em> in <var class="filename">.htaccess</var> files.         Any directive type set with <code class="systemitem systemitem">php_admin_value</code>         can not be overridden by <var class="filename">.htaccess</var>.         To clear a previously set value use <i>none</i> as the value.        </p>       </dd>      </dt>      <dt>       <span class="term">        <code class="systemitem systemitem">php_admin_flag</code>        <i><tt class="parameter">name</tt></i>        <i><tt class="parameter">on|off</tt></i>       </span>       <dd>        <p class="para">         Used to set a boolean configuration directive.         This <em class="emphasis">can not be used</em> in <var class="filename">.htaccess</var> files.         Any directive type set with <code class="systemitem systemitem">php_admin_flag</code>         can not be overridden by <var class="filename">.htaccess</var>.        </p>       </dd>      </dt>     </dl>    </p>    <p class="para">     <div class="example">      <p><b>Example #1 Apache configuration example</b></p>      <div class="example-contents"><div class="cdata"><pre>&lt;IfModule mod_php5.c&gt;  php_value include_path &quot;.:/usr/local/lib/php&quot;  php_admin_flag safe_mode on&lt;/IfModule&gt;&lt;IfModule mod_php4.c&gt;  php_value include_path &quot;.:/usr/local/lib/php&quot;  php_admin_flag safe_mode on&lt;/IfModule&gt;</pre></div>      </div>     </div>    </p>    <div class="caution"><b class="caution">Caution</b>     <p class="para">      PHP constants do not exist outside of PHP. For example, in       <var class="filename">httpd.conf</var> you can not use PHP constants       such as <b><tt>E_ALL</tt></b> or <b><tt>E_NOTICE</tt></b>       to set the <a href="errorfunc.configuration.html#ini.error-reporting" class="link">error_reporting</a>       directive as they will have no meaning and will evaluate to      <em class="emphasis">0</em>. Use the associated bitmask values instead.      These constants can be used in <var class="filename">php.ini</var>     </p>    </div>   </div>   <div id="configuration.changes.windows" class="sect2">    <h3 class="title">Changing PHP configuration via the Windows registry</h3>     <p class="simpara">      When running PHP on Windows, the configuration values can be      modified on a per-directory basis using the Windows registry. The      configuration values are stored in the registry key       <i>HKLM\SOFTWARE\PHP\Per Directory Values</i>,       in the sub-keys corresponding to the path names. For example, configuration       values for the directory <i>c:\inetpub\wwwroot</i> would      be stored in the key <i>HKLM\SOFTWARE\PHP\Per Directory      Values\c\inetpub\wwwroot</i>. The settings for the      directory would be active for any script running from this      directory or any subdirectory of it. The values under the key      should have the name of the PHP configuration directive and the      string value. PHP constants in the values are not parsed.       However, only configuration values changeable in       <b><tt>PHP_INI_USER</tt></b> can be set      this way, <b><tt>PHP_INI_PERDIR</tt></b> values can not.     </p>   </div>      <div id="configuration.changes.other" class="sect2">    <h3 class="title">Other interfaces to PHP</h3>    <p class="para">     Regardless of how you run PHP, you can change certain values at runtime     of your scripts through <a href="function.ini-set.html" class="function">ini_set()</a>. See the documentation     on the <a href="function.ini-set.html" class="function">ini_set()</a> page for more information.    </p>    <p class="para">     If you are interested in a complete list of configuration settings     on your system with their current values, you can execute the     <a href="function.phpinfo.html" class="function">phpinfo()</a> function, and review the resulting     page. You can also access the values of individual configuration     directives at runtime using <a href="function.ini-get.html" class="function">ini_get()</a> or     <a href="function.get-cfg-var.html" class="function">get_cfg_var()</a>.    </p>   </div>  </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="configuration.html">Runtime Configuration</a></div> <div class="next" style="text-align: right; float: right;"><a href="langref.html">Language Reference</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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -