ysugimoto / Terrier

A simple mailform written by PHP
http://ysugimoto.github.io/Terrier/
MIT License
9 stars 1 forks source link

$mail['admin_email’]にカンマ区切りで複数メールアドレスを指定したとき #8

Closed maki-t2nd closed 9 years ago

maki-t2nd commented 9 years ago

送信後、以下のようなエラーメッセージが表示されます。

Warning: date(): 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 /path/to/application/Terrier/Template.php(226) : runtime-created function on line 1

Warning: date(): 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 /path/to/application/Terrier/Driver/Mail/PhpMail.php on line 86

Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): 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 /path/to/application/Terrier/Log.php:54 Stack trace: #0 /path/to/application/Terrier/Log.php(54): DateTime->__construct() #1 /path/to/application/Terrier/Driver/Mail/PhpMail.php(65): Terrier\Log::write('Sended my mail(...', 1) #2 /path/to/application/Terrier/Driver/Mail/Driver.php(319): Terrier\Driver\Mail\PhpMail->_sendmail() #3 /path/to/application/Terrier/MailSender.php(97): Terrier\Driver\Mail\Driver->send() #4 /home/user/www in /path/to/application/Terrier/Log.php on line 54

環境はさくらのスタンダート、phpのバージョンは5.4です

ysugimoto commented 9 years ago

あー、これはTerrierではなくphp.iniの設定ですね。

php.iniが編集可能なら、

date.timezone = Asia/Tokyo

とするか、プログラム中のエントリポイントで、

date_default_timezone_set("Asia/Tokyo");

でOKです!

maki-t2nd commented 9 years ago

なるほど!

ありがとうございます!