PHP:系统时区设置错误 [英] PHP: System Timezone Setting error
问题描述
我试图在MAMP下的终端使用PHP,但我有一个与系统的时区设置相关的错误。如何修复此错误?
I'm trying to use PHP in the terminal under MAMP but I got an error related to the system's timezone settings. How can I fix this error?
$ /应用程序/ MAMP / bin / php5 / bin / php
echo.php
$/Applications/MAMP/bin/php5/bin/php echo.php
PHP严格标准:PHP启动:它
不能安全依赖系统的
时区设置。请使用
date.timezone设置,TZ
环境变量或
date_default_timezone_set()函数。
如果你使用任何这些方法
,你仍然得到这个
警告,你很可能拼写错误
时区标识符。我们选择
'Asia / Manila'代替'PHT / 8.0 / no DST'
,而不是在第0行的未知
PHP Strict Standards: PHP Startup: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 'Asia/Manila' for 'PHT/8.0/no DST' instead in Unknown on line 0
推荐答案
您需要设置日期。 php.ini文件中的时区
// London, England, Europe
date.timezone = "Europe/London"
date.default_latitude = 51.500181
date.default_longitude = -0.12619
或
date.timezone = America/Los_Angeles
这篇关于PHP:系统时区设置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!