【发布时间】:2011-05-31 21:52:47
【问题描述】:
我在使用 Symfony 2 时遇到了一些麻烦,试图通过以下方式生成架构:
php console/app generate:schema:create
我遇到了一个错误:
[Exception]
DateTime::__construct(): 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/Berlin' for 'CEST/2.0/DST' instead
因此,我正在尝试使用
更改我的 php.ini 中的时区date.timezone = 'Europe/Paris'
但即使我重新加载我的 apache,我仍然会得到 p>
date.timezone Europe/Zurich Europe/Zurich
如果我查看我的phpinfo(),那么我真的不知道接下来我应该尝试什么......而且我什至不确定我是否处于良好状态。
谢谢你帮助我
【问题讨论】:
-
Apache 是否使用您正在更改的 php.ini?根据您的设置,您可能还需要为多个 php.ini 配置它(一个用于 main,一个用于 Cli)。例如,如果您使用 MAMP,您的控制台命令可能看起来更像这样:
-
我没有使用 MAMP,我在 php_info() 文件中使用了命令
echo get_cfg_var('cfg_file_path');以确保我使用的是好的。 -
如果在命令行上执行 php --ini 会得到什么?
-
php -c /Path/to/php.ini_folder/app/console 命令
-
这个技巧对我有用:mikecroteau.wordpress.com
标签: macos symfony timezone php