<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/configuration.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'configuration.changes.php',
    1 => '設定を変更するには',
    2 => '設定を変更するには',
  ),
  'up' => 
  array (
    0 => 'configuration.php',
    1 => '実行時設定',
  ),
  'prev' => 
  array (
    0 => 'configuration.changes.modes.php',
    1 => 'どこで設定を行うのか',
  ),
  'next' => 
  array (
    0 => 'langref.php',
    1 => '言語リファレンス',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'install/ini.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="configuration.changes" class="sect1">
   <h2 class="title">設定を変更するには</h2>

   <div class="sect2" id="configuration.changes.apache">
    <h3 class="title">Apache モジュールとして PHP を実行している場合</h3>
    <p class="simpara">
     PHP を Apache モジュールとして使用している場合、Apache 設定ファイル (例、<var class="filename">httpd.conf</var>)
     もしくは <var class="filename">.htaccess</var> ファイルにディレクティブを記述することで、PHP の設定の変更を行うことが
     可能です。このようにして設定変更を行うには、&quot;AllowOverride Options&quot; もしくは
     &quot;AllowOverride All&quot; 権限が必要です。
    </p>

    <p class="para">
     Apache 設定ファイルから PHP の設定を変更するには、
     以下に示す Apache ディレクティブを使用します。
     各設定オプションの変更の可否 (<strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong>,
     <strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong>, または <strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong>)
     については、付録
     <a href="ini.list.php" class="link">php.ini ディレクティブのリスト</a>
     を参照ください。
    </p>

    <p class="para">
     <dl>
      
       <dt>
        <code class="systemitem systemitem">php_value</code>
        <code class="parameter">name</code>
        <code class="parameter">value</code>
       </dt>
       <dd>
        <p class="para">
         指定した設定オプションに値を設定します。変更の可否が、
         <strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong> もしくは
         <strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong> である設定オプションに対し利用できます。
         セット済みの値をクリアしたい場合は、<code class="literal">none</code> を
         値として使用してください。
        </p>
        <blockquote class="note"><p><strong class="note">注意</strong>: 
         <span class="simpara">
          論理値を設定する場合には <code class="systemitem systemitem">php_value</code>
          を使用しないでください。代わりに、<code class="systemitem systemitem">php_flag</code>
          （下記参照）を使用する必要があります。
         </span>
        </p></blockquote>
       </dd>
      
      
       <dt>
        <code class="systemitem systemitem">php_flag</code>
        <code class="parameter">name</code>
        <code class="parameter">on|off</code>
       </dt>
       <dd>
        <p class="para">
         設定オプションに論理値を設定するために使用します。変更の可否が、
         <strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong> もしくは
         <strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong> である設定オプションで利用できます。
        </p>
       </dd>
      
      
       <dt>
        <code class="systemitem systemitem">php_admin_value</code>
        <code class="parameter">name</code>
        <code class="parameter">value</code>
       </dt>
       <dd>
        <p class="para">
         指定した設定オプションに値を設定します。このディレクティブは、<var class="filename">.htaccess</var>
         ファイルでは利用できません。また、
         <code class="systemitem systemitem">php_admin_value</code>
         で設定された設定オプションの値は、<var class="filename">.htaccess</var>
         や <span class="function"><a href="function.ini-set.php" class="function">ini_set()</a></span> では上書きできません。
         セット済みの値をクリアしたい場合は、<code class="literal">none</code>
         を値として使用してください。
        </p>
       </dd>
      
      
       <dt>
        <code class="systemitem systemitem">php_admin_flag</code>
        <code class="parameter">name</code>
        <code class="parameter">on|off</code>
       </dt>
       <dd>
        <p class="para">
         設定オプションに論理値を設定するために使用します。
         このディレクティブは、<var class="filename">.htaccess</var> ファイルでは利用できません。
         php_admin_value で設定された設定オプションの値は、<var class="filename">.htaccess</var>
         や <span class="function"><a href="function.ini-set.php" class="function">ini_set()</a></span> では上書きできません。
        </p>
       </dd>
      
     </dl>
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>例1 Apache 設定の例</strong></p>
      <div class="example-contents">
<div class="inicode"><pre class="inicode">&lt;IfModule mod_php5.c&gt;
  php_value include_path &quot;.:/usr/local/lib/php&quot;
  php_admin_flag engine on
&lt;/IfModule&gt;
&lt;IfModule mod_php4.c&gt;
  php_value include_path &quot;.:/usr/local/lib/php&quot;
  php_admin_flag engine on
&lt;/IfModule&gt;</pre>
</div>
      </div>

     </div>
    </p>
    <div class="caution"><strong class="caution">警告</strong>
     <p class="para">
      PHP 定数は PHP 以外では使用できません。たとえば、
      <var class="filename">httpd.conf</var> の中で
      <a href="errorfunc.configuration.php#ini.error-reporting" class="link">error_reporting</a>
      オプションを設定しようとして <strong><code><a href="errorfunc.constants.php#constant.e-all">E_ALL</a></code></strong>
      や <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong> のような PHP 定数を使用することは
      できません。これらは意味を有さないため、
      <em>0</em> と評価されてしまいます。
      代わりに、対応するビットマスク値を使用してください。
      <var class="filename">php.ini</var> の中では、これらの PHP 定数を使用することができます。
     </p>
    </div>
   </div>

   <div class="sect2" id="configuration.changes.windows">
    <h3 class="title">Windows レジストリによる PHP の設定の変更</h3>
    <p class="simpara">
     Windows 上で PHP を実行している場合、Windows レジストリを使用して設定値を
     ディレクトリ毎に変更することができます。
     設定値は、レジストリキー <code class="literal">HKLM\SOFTWARE\PHP\Per Directory Values</code>
     に保存され、そのサブキーがパス名となります。例えば、ディレクトリ
     <code class="literal">c:\inetpub\wwwroot</code> に対する設定値は、 キー
     <code class="literal">HKLM\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot</code>
     に保存されます。ディレクトリに対する設定は、そのディレクトリ、
     およびそのサブディレクトリで実行されるすべてのスクリプトで有効となります。
     PHP 設定オプションのディレクティブを名前とする文字列値をキーに登録してください。
     また、値のデータに PHP 定数を記述しても解釈されませんので、注意してください。
     しかし、<strong><code><a href="info.constants.php#constant.ini-user">INI_USER</a></code></strong>
     で変更可能な設定値はこの方法で設定することが可能ですが、
     <strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong> である設定値は設定できません。
     なぜなら、これらの設定値はリクエストがあるたびに読み直されるからです。
    </p>
   </div>

   <div class="sect2" id="configuration.changes.other">
    <h3 class="title">他の方法</h3>
    <p class="para">
     どのように PHP を実行しているかに係わらず、<span class="function"><a href="function.ini-set.php" class="function">ini_set()</a></span> 関数を
     用いて、スクリプトの実行時に一部のオプションの設定値を変更することができます。詳細は、
     <span class="function"><a href="function.ini-set.php" class="function">ini_set()</a></span> 関数のリファレンスを参照ください。
    </p>
    <p class="para">
     使用しているシステムにおける現在のオプション設定値の完全なリストを得たい場合は、
     <span class="function"><a href="function.phpinfo.php" class="function">phpinfo()</a></span> 関数を実行し、出力された結果を参照ください。
     また、<span class="function"><a href="function.ini-get.php" class="function">ini_get()</a></span> 関数または <span class="function"><a href="function.get-cfg-var.php" class="function">get_cfg_var()</a></span>
     関数を用いて、個々のオプションの設定値にアクセスすることも可能です。
    </p>
   </div>
  </div><?php manual_footer($setup); ?>