I have two instances of zabbix running on two different RHEL servers. Data presented in web user interface on one are off by 2 hours and on the other by 3 hours (ahead). For example instead of 15:00 it says 17:00. Timezone in /etc/php.ini is set properly to America/Vancouver (the same as settings on my desktop). I use MySQL and database settings are ok as well. calling 'select now() from dual' test returns correct time.


returns correct time and I also created link

ln -sf /usr/share/zoneinfo/America/Vancouver /etc/localtime

and restarted zabbix server and the agent. Time in graphs is still two hours ahead.

Any help?

  • which zabbix version would that be ?
    – Richlv
    Mar 17 '11 at 11:05

Since none of the answers on this board helped me, I thought I'd tell you what worked for me.

The RHEL Zabbix installer will create an httpd configuration file that includes the DocumentRoot and a bunch of other settings. This file is copied (either by you or the installer) to a sub-directory under your httpd root (usually /etc/httpd), to either the sites-available or conf.d sub-directory. Many web servers contain multiple virtual hosts, so you must find the configuration file that contains the Zabbix DocumentRoot entry. In that file, look for the entry php_admin_value date.timezone 'UTC' -- change 'UTC' to the time zone you need then type service httpd restart.

Note: sites-available entries override the conf.d entries, so make sure modify the correct virtual hosts definition.


You issue could be similar to this bug.

  • It's not. Both server and the client are in the same timezone. We have another Zabbix server setup and it works fine. I just can't figure out which part of setup is different and why it works.
    – Tomas
    Mar 22 '11 at 20:37

I know Richlv already asked for Zabbix version. But What RHEL version?

Here is something to try. Create a php file in the zabbix web root and add the contents:

        echo date('M jS, H:i');

Then load the filename in the browser. This will help confirm if it is a PHP issue or not. Is it possible there are multiple php.ini files and one is being overlooked?

  • Andy, time is off by two hours. It seems like you are right. Where else can php.ini be? Is zone setting also somewhere in Zabbix itself? I am not much of PHP expert.
    – Tomas
    Mar 31 '11 at 18:19
  • In this case it wouldn't be related to Zabbix at all. Can you scan your system for php.ini? Also, what is the php version (php -v)?
    – Andy Shinn
    Mar 31 '11 at 19:29
  • php -v returns 'PHP 5.1.6 (cli) (built: Nov 13 2010 16:05:12)' and when I ran find / -name php.ini -print it returns only /etc/php.ini. My /etc/php.ini has line date.timezone = 'America/Vancouver'. When I get timezone in PHP using date_default_timezone_get() it returns 'America/Chicago'
    – Tomas
    Mar 31 '11 at 20:42
  • And I am using Apache with mod_php if it helps.
    – Tomas
    Mar 31 '11 at 20:49
  • Check commands: php -i | grep ini and php -i | grep timezone to see what they return. You may also want to try creating a php file in the webroot containing <?php phpinfo(); ?> and see what the values for ini files and timezone is. Command line PHP and mod_php could be different.
    – Andy Shinn
    Apr 1 '11 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.