Symfony 2&mamp pro date.timezone错误

I get an error that I've been two days have been busy along with Symfony 2 and MAMP pro.

The error message is: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.

  • my OS is: OS X version 10.9.5
  • MAMP PRO version is 3.0.5
  • PHP version is 5.5.10
  • Symfony version 2.6

I have the php.ini files modified in etc folder (that I have found with phpinfo ())

I also tried using date_default_timezone_set (Europe / Amsterdam); to solve the problem, but it dit not helped either.

Therefore I can not create Bundle via Terminal, I get the same error message.

Is there another solution to this problem?

Thanks in advance! :)

I had this very same problem some time ago. I guess you're executing the symfony commands using your OS X console (SF installation, SF commands and so on).

The thing is that the php command you're running in your OSX console is using the php.ini of your system and not the one from MAMP.

You have two solutions:

  1. Change the php.ini of your system and set the required settings (everything will work perfectly)
  2. Set up your system so that you use the PHP version you installed with MAMP

If you go for the second option, here you can find help on how to do it:

How to run a PHP script from the command line with MAMP?

Good luck.