PHP Warning: date() [function.date]: It is not safe to rely on the system’s timezone settings.

Недавно, после апдейта сервера и его перезапуска отказался работать Cacti выдавая вот такую странную ошибочку —

PHP Warning: date() [<a href=’function.date’>function.date</a>]: 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/Helsinki’ for ‘EEST/3.0/DST’ instead in /var/www/vhosts/cacti.teaseo.ru/httpdocs/include/global_arrays.php on line 638, referer: http://cacti.teaseo.ru/graph_view.php?action=tree&tree_id=1&leaf_id=511r

Решение оказалось очень простым. Раз уже система выбрала Europe/HelsinkЮ пусть так и будет, Хельсинки находится с Киевом в одной часовой зоне и меня вполне устраивает. В /etc/php.ini добавляем:

date.timezone = «Europe/Helsinki»

One thought on “PHP Warning: date() [function.date]: It is not safe to rely on the system’s timezone settings.

Leave a Reply

Ваш адрес email не будет опубликован. Обязательные поля помечены *

You may use these HTML tags and attributes:

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