date_default_timezone_get():依赖系统的时区设置是不安全的 [英] date_default_timezone_get(): It is not safe to rely on the system's timezone settings

查看:45
本文介绍了date_default_timezone_get():依赖系统的时区设置是不安全的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我为什么在安装了最新 MAMP 的全新格式化 macbook 中运行应用程序/控制台时会出现此错误?

Can anyone tell me why am I getting this error when running app/console in a brand new formatted macbook with the latest MAMP installed ?

警告:date_default_timezone_get():依赖系统的时区设置是不安全的.您*需要*使用 date.timezone 设置或 date_default_timezone_set() 函数.如果您使用了这些方法中的任何一种并且仍然收到此警告,则很可能是时区标识符拼错了.我们为EEST/3.0/DST"选择了Europe/Helsinki",而不是在/../Logger.php 第 112 行

Warning: date_default_timezone_get(): 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 'Europe/Helsinki' for 'EEST/3.0/DST' instead in /../Logger.php line 112

我已经检查了php.ini的路径并标出了date.timezone = "Europe/Athens"

I have checked the path of php.ini and marked out the date.timezone = "Europe/Athens"

还多次重启了 MAMP/apache.

Also restarted MAMP/apache several times.

推荐答案

默认 php.ini 在 OS X 中位于:

Default php.ini in OS X is located at:

/private/etc/php.ini

无论如何,您可以告诉 CLI php 加载 MAMP设置,或使用 MAMP 命令本身的别名.

Anyway, you'll can either tell CLI php to load MAMP settings, or use an alias of MAMP command itself.

这篇关于date_default_timezone_get():依赖系统的时区设置是不安全的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆