next up previous contents
Next: 問題十一 Up: 問題解決 Previous: 問題九   Contents

問題十

  1. 網頁 php 警告或錯誤訊息如下:
    PHP Warning:  strtotime(): 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.
    
    PHP 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.
    
  2. 解決方式:php.ini 必須設定時區。
    [root@moodle moodle23]# grep timezone /etc/php.ini
    ; Defines the default timezone used by the date functions
    ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
    date.timezone = Asia/Taipei
    



2017-08-04