Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#667634: cacti uses wrong timezone and logs PHP warnings

1,403 views
Skip to first unread message

Christoph Kling

unread,
Apr 5, 2012, 9:50:02 AM4/5/12
to
Package: cacti
Version: 0.8.7i-2
Severity: normal

Dear Maintainer,

cacti logs dozens of warnings in its /var/log/cacti/poller-error.log.

The message is:


"PHP Warning: date(): 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 /usr/share/cacti/site/include/global_arrays.php on line 672"

The warning does matter because cacti logs the wrong times. Graphs are using UTC instead of the local server time.

The reason for this bug could be the upgrade to PHP 5.4.


Regards,
Christoph


-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages cacti depends on:
ii apache2 2.2.22-2
ii apache2-mpm-worker [httpd] 2.2.22-2
ii dbconfig-common 1.8.47+nmu1
ii debconf [debconf-2.0] 1.5.42
ii libphp-adodb 5.15-1
ii mysql-client-5.1 [virtual-mysql-client] 5.1.61-2
ii php5 5.4.0-3
ii php5-cli 5.4.0-3
ii php5-mysql 5.4.0-3
ii php5-snmp 5.4.0-3
ii rrdtool 1.4.7-1
ii snmp 5.4.3~dfsg-2.4
ii ucf 3.0025+nmu2

Versions of packages cacti recommends:
ii iputils-ping 3:20101006-1+b1
ii logrotate 3.8.1-1
ii mysql-server-5.1 [mysql-server] 5.1.61-2

Versions of packages cacti suggests:
pn php5-ldap <none>

-- Configuration Files:
/etc/cron.d/cacti changed [not included]

-- debconf information:
cacti/mysql/admin-pass: (password omitted)
cacti/password-confirm: (password omitted)
cacti/app-password-confirm: (password omitted)
cacti/mysql/app-pass: (password omitted)
cacti/db/app-user: cacti
cacti/mysql/admin-user: root
* cacti/webserver: Apache2
cacti/mysql/method: unix socket
cacti/remote/host:
cacti/upgrade-error: abort
cacti/dbconfig-upgrade: true
cacti/internal/skip-preseed: false
cacti/remote/newhost:
cacti/purge: false
cacti/missing-db-package-error: abort
cacti/database-type: mysql
cacti/remove-error: abort
cacti/db/dbname: cacti
cacti/upgrade-backup: true
cacti/install-error: abort
cacti/internal/reconfiguring: false
cacti/passwords-do-not-match:
* cacti/dbconfig-remove:
* cacti/dbconfig-install: true
cacti/remote/port:
cacti/dbconfig-reinstall: false
_______________________________________________
sysadm mailing list
sys...@lists.alphasky.net
http://lists.alphasky.net/listinfo/sysadm
PGP.sig

Paul Gevers

unread,
Apr 6, 2012, 2:50:02 PM4/6/12
to
forwarded 667634 http://bugs.cacti.net/view.php?id=2202
tags 667634 wontfix
thanks

Upstream references to http://docs.cacti.net/faq#time_zone_warning where
it says:

[quote]
Time Zone Warning

Similar to the Deprecated Warning, you may see the following warning in
your logs

"""
PHP Warning: strtotime(): 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 in
/usr/share/cacti/include/global_constants.php on line 156
"""

In this case, simply follow the directions. Set your timezone in
/etc/php.ini

"""
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone =America/Regina
"""

Of course, read
http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone ,
and find your correct timezone.

As always, restart apache after any change to /etc/php.ini
[/quote]

signature.asc
0 new messages