[Valid RSS]

Get rid of MantisBT date_default_timezone_get() warning

If you installed a MantisBT instance on a system with a recent PHP version, there’s the chance you get a warning saying:

SYSTEM 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 ‘Europe/Berlin’ for ‘CET/1.0/no DST’ instead

A quick way to get rid of this is to set an explicit time zone.

Just open the config_inc.php file and add the date_default_timezone_set() line.

  1. <?php
  2. date_default_timezone_set("Europe/Rome");
  3. $g_hostname = 'localhost';
  4. $g_db_type = 'mysql';
  5. $g_database_name = 'db_name';
  6. $g_db_username = 'user';
  7. $g_db_password = 'secret';
  8. ?>

Please refer to this list to discover the available time zones.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>