suPHP_ConfigPathでphp.iniの場所を指定してあげて、ユーザはそのphp.iniを編集する。suPHPのphp.iniの設定の場合、apache dsoモジュールで.htaccessからは変更できないphp_admin_value/php_admin_flagの設定も上書きできる。
デフォルトからの変更している設定の問題
suPHP_ConfigPathをユーザに使用させると、デフォルトから変更している内容がリセットされるようだ。defaultのphp.iniとユーザが設定したphp.iniはmergeしてくれないのな。
ex:) expose の値
phpのデフォルトがexpose = Onなので、/usr/local/php/lib/php.iniをexpose = Offにする。
このとき、suPHP_ConfigPathを設定していないURLについては expose = Offになっている。が、suPHP_ConfigPathを設定したURLでは、expose = Onに戻ってしまっている。もちろんphp.iniでexpose設定を上書きはしていない。
ここにも書いてた。
- SuPHP Considerations
(略)
NOTE: PHP does not merge the php.ini files together, so when a custom php.ini is used it must contain all
of the required directives from the main php.ini file (for example, if Zend Optimizer is required, the new php.ini must load the extension.)
あとここも。
Conclusions:
1. mod_suphp has no php.ini cascading nor php.ini merging: it will not look in parent directories and it will not merge configuration files.
まとめ
おまけ
.htaccessでphp_valueが使えないけど?っていうFAQ があった。
Can I use the php_value directives in .htaccess files with suPHP?
suPHP does not support the php_value/php_admin_value directive known by mod_php to parse configuration options to scripts for certain virtual hosts or directories.
おや?そういえばmod_suphpを使わずに、cgi版のphpを普通に使う場合はどうやってphp.iniの設定を上書きすればいいんだろう。
http://php.net/manual/ja/configuration.changes.php ここに書いてた。
ということだからsuphpを使わずにphpをcgiで動かしている場合は設定変更は基本無理なのか。ソースを編集して
<?php ini_set ( string $varname , string $newvalue ); ?>
とやって変更するしかない。もちろんこれもphp_admin_value, php_admin_flagのものは変更できない。