今天独立安装了下apache2.2.15 和php5.3.3 ,配置完成后phpinfo()了一下发现了这个warning :
Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system’s timezone settings.
Warning: phpinfo() [function.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 ‘UTC’ for ’8.0/no DST’ instead in C:\Apache2.2\htdocs\phpinfo.php on line 2
之前总是用打包好的WAMP环境来开发,没注意过,这个warning是提示phpinfo 加载php.ini中的 date 模块儿时找不到安全的时区定义,显示phpinfo是默认选择了“UTC” 来代替,消除这个warning 很简单,可以在phpinfo();调用之前用date_default_timezone_set(‘PRC’)来指定一下默认时区,或者干脆找到php.ini的“date.timezone”一行改为“date.timezone=PRC”即可解决问题.
最新评论