2017年6月26日 星期一

走向未來吧


我也不知道未來怎麼發展,
盼求每個當下都上最好的思考。

跟你的想像怎麼充滿了很多不一樣的選擇

Go for it ~~

Actions, not words, reveal our real values | Derek Sivers https://sivers.org/arv


2017年6月8日 星期四

[php] Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings


出現下列錯誤訊息

[vagrant@c1 tmp]$ php t2.php
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. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /vagrant/my_pgapi/tmp/t2.php:2
Stack trace:
#0 /vagrant/my_pgapi/tmp/t2.php(2): DateTime->__construct()
#1 {main}
 thrown in /vagrant/my_pgapi/tmp/t2.php on line 2

找出 config 檔案位置

[vagrant@c1 tmp]$ php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
PHP Warning:  Unknown: 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 Unknown on line 0

加入 timezone 資訊

$ sudo vim /etc/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =                                                                                                                                                                

date.timezone =  Asia/Taipei