0

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! :)

Selin
  • 1
  • 1
  • which ``php.ini`` file did you modify? you probably have two of them - one for ``apache`` and one for ``cli`` - you need to modify both – Tomasz Madeyski Feb 03 '15 at 17:53

1 Answers1

0

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.

Community
  • 1
  • 1
acontell
  • 6,792
  • 1
  • 19
  • 32
  • Thanks for your answer! I changed the php.ini of my system and it still doesn't work.. – Selin Feb 03 '15 at 18:35
  • @Selin Hi, check with `php --ini` if the php.ini of your system that you modifed is the one that php command is using. Also check this [answer](http://stackoverflow.com/questions/9343151/where-is-php-ini-in-mac-os-x-lion-thought-it-was-in-usr-local-php5-lib) to find out more about the topic. It's a bit more trickier than it seems because there can be more than one php.ini in a system – acontell Feb 03 '15 at 18:44
  • I checked php --ini and all of them but it still doesn't work :) – Selin Feb 03 '15 at 19:05
  • are you restarting the apache server of your system after making the changes to the php.ini of your system? – acontell Feb 03 '15 at 19:16
  • yes i did. i'm going to try xampp instead of mamp pro.. maybe it will work there without erorrs. Thanks for your help! – Selin Feb 03 '15 at 19:25
  • Pity. I usually work with a VM, though I have workmates that use xampp and so on. I prefer VM though. Good luck anyway – acontell Feb 03 '15 at 19:29