phpinfo在MAMP中显示date.timezone警告

时间:2012-11-28 06:40:59

标签: php timezone mamp phpinfo

我在MAMP中运行了一个phpinfo()函数,并收到了以下警告,嵌入在php信息表中:

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 'America/New_York' for 'EST/-5.0/no DST' instead in /Applications/MAMP/bin/mamp/phpinfo.php on line 2 

php.ini文件中的date.timezone设置为'America / New_York',警告只比phpinfo表中反映的实际设置高三行!

有人可以向我解释如何解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

您确定.ini文件中的时区周围没有引号?

date.timezone = America / New_York

http://www.php.net/manual/en/timezones.america.php#85815