【发布时间】:2015-04-20 21:19:55
【问题描述】:
我为 Windows 安装了 MAMP
几个小时以来我一直有这个错误......
[Symfony\Component\Debug\Exception\ContextErrorException]
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 me
thods and you are still getting this warning, you most likely misspelled th
e timezone identifier. We selected the timezone 'UTC' for now, but please s
et date.timezone to select your timezone.
在相关的php.ini (C:/MAMP/conf/php5.5.19/php.ini) 中,我将 DATE 行更改为:
[Date]
; Defines the default timezone used by the date functions
date.timezone = "Europe/Paris"
在我的phpinfo() 中,加载的路径是:
Loaded Configuration File C:\MAMP\conf\php5.5.19\php.ini
当我在控制台中执行命令 php --ini 我有这个:
C:\Users\Thomas>php --ini
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File: (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
为什么Configuration File (php.ini) Path: 是"C:\Windows" 而不是C:\MAMP\conf\php5.5.19\。我可以更改此路径吗?
我现在不知道该怎么办......
谢谢!
【问题讨论】:
-
修改后是否重启了apache服务器?
-
@Brewal :我按照说明进行操作,但无事可做。是的,我用 MAMP 重新启动了 apache 服务器。
-
出现的错误是针对 CLI php,而不是针对 Web 服务器,因此重新启动 Apache 将没有任何意义。您确定您访问的是正确的 PHP 二进制文件吗?
-
哦,您正在尝试从您的 IDE 中执行此操作....您是否将 IDE 设置为使用 MAMP php 二进制文件? jetbrains.com/phpstorm/help/…
标签: php symfony timezone mamp ini