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 ?
Warning: da
By default Mac uses in the console the PHP located at:
/private/etc/php.ini
You should use this one because MAMP always unset the timezone variable and you would always get that error.
I had the exact same problem with my SF2 installation.
To fix this just go into your php.ini
file at /etc/php.ini
and change your file to look like this (adjust your timezone to suit your local timezone):
;;;;;;;;;;;;;;;;;;; ; Module Settings ; ;;;;;;;;;;;;;;;;;;;
[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = Europe/London
I had the same problem, and it's true there is a command line, and MAMP/Native Mac PHP service running on Yosemite, and while I was trying to follow the directions on this page non of them seemed to work for me.
When I ran php command:
$ php -i | grep 'Configuration File'<br>
Configuration File (php.ini) Path => /etc<br>
Loaded Configuration File => <em>(Blank)</em>
I realized that the php.ini that the CLI was using, was actually php.ini.default file. I created a symbolic link to that file as the php.ini and everything worked.
My-MacPro:/etc/$ ln -s php.ini.default php.ini
You don't edit the good php.ini file
You can get a full phpinfo() using :
php -i
And, in there, there is the php.ini file used :
$ php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Default php.ini
in OS X is located at:
/private/etc/php.ini
Anyway, you'll can either tell CLI php to load MAMP settings, or use an alias of MAMP command itself.
I did follow your answers, but in my case none of them worked. I decided to go change the
date_default_timezone_get()
in the logger.php file.
I replaced with my timezone setting ("Europe/Berlin"), and all went well !
Old school solution but still a solution.