LoginSignup
0

More than 5 years have passed since last update.

It is not safe to rely on the system's timezone settings. と言われたらphp.iniの設定を確認する

Posted at

brewでPHPを導入したが、Datetimeクラスのインスタンスを作ろうとした時にエラーが出た。

原因

php.iniの設定が初期設定のままだった。

対処

php.ini
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Tokyo

Asia/Tokyoを設定した。
エラーが消えた。

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