php.ini にタイムゾーンを設定してもエラーが解消しない

問題

IISCGIPHP を実行した時に次のメッセージが表示される。php.ini でタイムゾーンを設定したが解消しない。

PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

PHP 警告: phpinfo(): システムのタイムゾーン設定を信用するのは安全ではありません。 必ず date.timezone 設定、または date_default_timezone_set() 関数を使用してください。これらを行っても警告が消えない場合は、おそらくタイムゾーン識別子を書き間違えています。現在はタイムゾーン 'UTC' が選択されています。date.timezone をセットして、適切なタイムゾーンを選択してください。

環境

原因

php.ini にアクセス権が無かったため。

解決方法

php.ini を含むフォルダー(PHP インストールフォルダー)に、ユーザー IIS_IUSRS の読み取り許可を付ける。