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).
php.ini のセクション一覧
この一覧では、ホスト単位やパス単位で PHP の設定を行いたい場合に設定する php.ini のセクションをまとめます。これらのセクションはオプションです。
これらのセクションは、PHP に直接影響を及ぼすわけではありません。 さまざまな php.ini ディレクティブをひとまとめにして、 それを特定のホストや特定のパスにだけ適用する場合に使用します。
| 名前 | 変更の可否 | 変更履歴 |
|---|---|---|
| [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 のセクション一覧
public at grik dot net
25-Sep-2009 07:00
25-Sep-2009 07:00
christopher dot jones at oracle dot com
20-Mar-2009 03:38
20-Mar-2009 03:38
HOST and PATH are supported only for the FCGI API, and will not work for the PHP CLI or Apache mod (Source: pierre at php dot net)
