大家好,请教一个问题系统是2003,安装有framework2.0,fastcgi,iis6.0,php5.4.4配置php5.4.4后,使用iProber探针,除服务器时间外,都显示正常。服务器时间显示: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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\inetpub\wwwroot\iProber.php on line 231
2012年7月9日 07:42:02 北京时间: 2012年7月9日 15:42:02重新配置php.ini,改为date.timezone = Asia/Shanghai和date.timezone = PRC,均无效(已经去掉了前面的;),探针服务器时间问题依旧。服务器时区和时间是正常的,参考http://topic.csdn.net/u/20100708/21/a6086a64-6ce5-4f53-9251-cb9365bf0eb1.html 帖子,CunningBoy兄说的“TZ应该是phpinfo()列出的date部分的Default timezone”没有找到位置。烦请朋友们帮忙看看,多谢!
2012年7月9日 07:42:02 北京时间: 2012年7月9日 15:42:02重新配置php.ini,改为date.timezone = Asia/Shanghai和date.timezone = PRC,均无效(已经去掉了前面的;),探针服务器时间问题依旧。服务器时区和时间是正常的,参考http://topic.csdn.net/u/20100708/21/a6086a64-6ce5-4f53-9251-cb9365bf0eb1.html 帖子,CunningBoy兄说的“TZ应该是phpinfo()列出的date部分的Default timezone”没有找到位置。烦请朋友们帮忙看看,多谢!
date_default_timezone_set()
多谢指导,我把date_default_timezone_set('PRC'),直接替换了php.ini中的date.timezone = PRC,但探针的服务器时间仍报错误。
-----------------
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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\inetpub\wwwroot\iProber.php on line 231
2012年7月9日 08:40:12 北京时间: 2012年7月9日 16:40:12
---------------
上面的iProber.php,是我探针的php访问页面。另外你说的“echo date('Y-m-d H:i:s');”,所表现出来的是不是就是上面显示的“2012年7月9日 08:40:12 北京时间: 2012年7月9日 16:40:12”?除了前后两个时间相差8小时外,应该没问题吧。是不是程序在调用我php.ini之前,优先调用了其他的timezone,导致后续php.ini正确设置失效,但我找不到之前调用的内容在哪里,可以推断调用的是UTC的时间。
Warning: phpinfo(): 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 C:\inetpub\wwwroot\iProber.php on line 58
date/time support:enabled
"Olson" Timezone Database Version : 2012.3
Timezone Database : internal
Default timezone : UTC这里已经明确的看到Default timezone是 UTC了,但是无法修改。
麻烦了,请多费心,谢谢
?>这是php页面代码 保存成一个文件 然后在浏览器里打开这个网址看看.比如服务器上 localhost/index.php不需要apache 因为你已经可以看探针那就说明你的环境应该已经正常了