本地php.ini为什么默认时区与Main php.ini不同

时间:2016-01-20 21:27:40

标签: php linux timezone

在服务器上,

$date
Wed Jan 20 13:28:04 PST 2016

在主php.ini上,

默认时区设为America/Los_Angeles

如果我删除了本地php.ini并打印phpinfo(),我可以确认。

但是,当存在本地php.ini时,无论文件没有更改默认时区的配置,默认时区都将更改为UTC。它会生成此错误

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.

我理解date_default_timezone_set()可以解决此错误。

但是,我想知道是什么问题,为什么不正确加载默认时区。因为我不想把这个功能放到脚本中.....

谢谢你的建议!!

0 个答案:

没有答案
相关问题