2

I have researched all the answers I can find for this and have had no luck getting it to work.

I am getting the following error when I try to run symfony.

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. in /symfony_project/app/cache/dev/classes.php line 5229

I have checked the following :

php --ini

Configuration File (php.ini) Path: /etc Loaded Configuration File:
/etc/php.ini

I have changed the ini file to date.timezone = "Europe/Dublin"

restarted apache Cleared the cli cache cleared the browser cache

Ran phpinfo and confirmed the

loaded config file is etc/php.ini Additional .ini files parsed (none) date.timezone = "Europe/Dublin" I also ran echo date_default_timezone_get() in the browser and I get Europe/Dublin

I am running PHP v 5.4.24 (for what its worth)

I ran echo date_default_timezone_get() inside which returns UTC ... so it looks like symfony is not reading the php.ini file properly.

Not sure what else I can do.

A.L
  • 10,259
  • 10
  • 67
  • 98
Barry McMahon
  • 101
  • 1
  • 9

1 Answers1

-1
  1. find your php.ini file path

    php -i | grep php.ini
    
  2. edit php.ini date_timezone set it is your timezone

    time_zone = "Asia/Shanghai"
    
  3. restart your nginx and php-fpm

Regolith
  • 2,944
  • 9
  • 33
  • 50
anke
  • 1
  • 1