PHP のタイムゾーンを修正する

FreeBSDPHP-FPM を設定して稼働確認を取ったら、下記のようなエラーが出た。

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. in /usr/local/www/nginx-dist/info.php on line 2

ということで、タイムゾーンの設定を施す。

% sudo vi /usr/local/etc/php.ini

PHP の設定ファイルを変更する。

;date.timezone =
;コメントアウトして、東京の時間帯で設定をする
date.timezone = "Asia/Tokyo"

変更を保存したら、PHP-FPM に設定ファイルを再読み込みさせる。

% sudo /usr/local/etc/rc.d/php-fpm reload

そして、最初のエラーが消えていれば、完了。