最近买了个美国的虚拟服务器,正在装修中ing,在执行php -r "echo date('Ymd');"时,报
Notice: Use of undefined constant Ymd - assumed 'Ymd' in Command line code on line 1
PHP 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 'Asia/Chongqing' for
'CST/8.0/no DST
|
查了一下,通过修改php.ini,问题解决.
wds@10.54.38.18>:# cat php.ini | grep "date.timezone"
;
;date.timezone =
将date.timezone注释去掉,然后date.timezone = Asia/Shanghai 问题解决.
阅读(6604) | 评论(0) | 转发(0) |