0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

さくらのレンタルサーバーで、PHPのtimezoneエラーが出たため設定を整える

Last updated at Posted at 2015-09-18

「さくらのレンタルサーバー」スタンダードプランで、
phpinfo() を表示したところ、以下のようなtimezoneエラーが発生

date

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 /home/hogehoge/www/phpinfo.php on line 2

php.iniにtimezoneの設定がされていないことによるエラー。

さくらのコントロールパネルから、php.iniに以下を追記。

date.timezone = Asia/Tokyo

これでエラーが解消される.

phpのコードを書いても、エラーが表示されない。

同じく、php.iniに以下を追記

display_errors = On

これでphpのエラーが表示されるようになる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?