Adding PATH= applies only to the named path and does not include sub-directories, you have to add a PATH= value for each sub-directory.
Also some settings have no effect even though phpinfo recognises and displays the per-folder value as the 'local' value, and the default as the 'master' value.
'fastcgi.impersonate' always uses the master setting.
php.ini のセクション一覧
この一覧では、ホスト単位やパス単位で PHP の設定を行いたい場合に設定する php.ini のセクションをまとめます。これらのセクションはオプションです。
これらのセクションは、PHP に直接影響を及ぼすわけではありません。 さまざまな php.ini ディレクティブをひとまとめにして、 それを特定のホストや特定のパスにだけ適用する場合に使用します。
これらのセクションは CGI/FastCGI モードでのみ使用します。 extension および zend_extension ディレクティブは設定できません。
| 名前 | 変更の可否 | 変更履歴 |
|---|---|---|
| [HOST=] | PHP_INI_SYSTEM | PHP 5.3.0 で追加。 |
| [PATH=] | PHP_INI_SYSTEM | PHP 5.3.0 で追加。 |
以下に設定ディレクティブに関する 簡単な説明を示します。
- [HOST=<host>]
-
このセクションで指定した php.ini ディレクティブは、 指定した名前のホスト上でのみ有効となります。
例1 dev. ドメインではエラーを画面に表示させるようにする例
[HOST=dev.site.com] error_reporting = E_ALL display_errors = On
- [PATH=<path>]
-
このセクションで指定した php.ini ディレクティブは、 指定したパスで実行したスクリプトでのみ有効となります。
例2 保護エリア内でのスクリプトのセキュリティ確保
[PATH=/home/site/public/secure] auto_prepend_file=security.php
php.ini のセクション一覧
robert dot johnson at icap dot com
12-Apr-2010 05:26
12-Apr-2010 05:26
public at grik dot net
24-Sep-2009 10:00
24-Sep-2009 10:00
In [HOST=...] one should use only the 1st server name from the list of server names.
I.E. if you have
server_name example.com, example2.com;
and will use www.example.com in a browser,
use [HOST=example.com] in php.ini for both addresses.
PHP looks not at the HOST request header (as I expected), but at the SERVER_NAME parameter (which by default is the 1st from the list of names, no matter what the HOST is).
