Created
October 12, 2014 20:40
-
-
Save amonmoce/c16878f155bfb5173f9f to your computer and use it in GitHub Desktop.
Cannot run php app/console ... when I do so I have a problem related to date_default_timezone_get ....
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Symfony 2 error: | |
====================== | |
[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 | |
methods and you are still getting this warning, you most likely misspelle | |
d the timezone identifier. We selected the timezone 'UTC' for now, but ple | |
ase set date.timezone to select your timezone. in /Users/amonmoce/Document | |
s/Web/www/ZakafricaProject/vendor/monolog/monolog/src/Monolog/Logger.php l | |
ine 233 | |
==================== | |
Solution: | |
I just went to the indicated file and I added the 2nd line ... | |
if (!static::$timezone) { | |
date_default_timezone_set('Asia/Taipei'); | |
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for your contribution.