2

当我重新启动 apache2 并重新加载页面时,日志文件显示

boogie.tontut.fi - - [28/Oct/2008:03:27:49 +0200] "GET /test HTTP/1.1" 404 457 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3"

……应该如此,就像03:27:49现在一样。但是,当我再次单击刷新按钮时,新的日志条目是:

boogie.tontut.fi - - [27/Oct/2008:21:27:52 -0400] "GET /test HTTP/1.1" 404 457 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3"

偏移量已经改变+0200 to -0400,我不知道这是从哪里来的。

如何开始解决此问题?

4

4 回答 4

1

须藤 vim /etc/php5/apache2/php.ini

添加时区

date.timezone="欧洲/伦敦"

重启 apache2 /etc/init.d/apache2 重启

于 2014-08-14T07:25:06.063 回答
0

在 apache 中运行的东西是否可能会更改其环境中的语言环境设置?

就像是:

  1. 第一次重新加载:记录消息GMT+2
  2. Apache 运行 /weird_script.php 调用某种setlocale()
  3. 第二次重新加载,新环境设置生效,导致日志消息GMT-4
于 2008-10-28T03:43:19.810 回答
0

尝试在以下位置明确设置您的时区httpd.conf

SetEnv TZ GMT+2
于 2008-10-28T01:56:32.617 回答
0

Maybe looking at the system call would help; on Unix its gettimeofday and on Windows its GetSystemTime.

于 2008-10-28T03:18:43.963 回答