Ad Widget

Collapse

PHP Timezone pre-requisite fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kdx200rider
    Junior Member
    • Oct 2008
    • 25

    #1

    PHP Timezone pre-requisite fails

    Hello,

    Installing Zabbix 1.6.4 on a VM running CentoS 5.3 64 bit. Install seemed to go fine, I used the script from Brendon Baumgartner.

    I wanted to see how the DB connection was setup so I selected Installation from the Administration menu. When I get to the pre-requisites window I see a "Fail" in the PHP timezone test. The timezone is set and is displayed properly but still fails. I'm sure the /etc/php.ini file is being read, if I change the timezone value it is reflected in the pre-requisite check.

    Has anyone run into this before?

    Here are my details:

    Zabbix 1.6.4
    CentOS 5.3 64 bit
    php-5.1.6-23.2.el5_3
    httpd-2.2.3-22.el5
    mysql-server-5.0.45-7.el5
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    Just to double-check, have you verified your php.ini "date.timezone=" entry here to make sure spacing/capitalization are correct?



    Make any necessary changes to your php.ini and then re-run your prerequisite check.

    Comment

    • kdx200rider
      Junior Member
      • Oct 2008
      • 25

      #3
      Thanks for replying tchjts1.

      I did actually. I tried to cut and paste the value and also tried just typing it in. The value I am using is "America/New_York". So the line in the config looks like:

      date.timezone=America/New_York

      Thanks for help!

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Try a space before and after the = sign, like so...

        date.timezone = America/Los_Angeles

        That is how mine is. Dunno if that makes a difference.

        Oh, and so we are not overlooking an obvious... this is the file you are editing, correct? /etc/php5/apache2/php.ini
        Last edited by tchjts1; 13-04-2009, 19:33.

        Comment

        • kdx200rider
          Junior Member
          • Oct 2008
          • 25

          #5
          Thanks I did try that and it did not seem to help.

          The file I have is /etc/php.ini, I searched for others on this system but could not find any.

          I believe it is the file that Zabbix is looking at, if I put an "X" at the end. I see the "X" appear in the Zabbix pre-requistes page.

          Comment

          • kdx200rider
            Junior Member
            • Oct 2008
            • 25

            #6
            I believe I have found the problem. I took at look at our existing Zabbix 1.4.6 server and found a difference in the /var/www/html/zabbix/include/setup.inc.php file compared to our 1.6.4 version.

            1.4.6 Version:

            $tmezone = ini_get('date.timezone');
            $table->AddRow(
            $this->get_test_result(
            $final_result,
            'PHP Timezone:',
            empty($tmezone) ? 'n/a' : $tmezone,
            !empty($tmezone),
            'Timezone for PHP is not set. Please set "date.timezone" option in php.ini.'));
            unset($tmezone);

            1.6.4 Version:

            $tmezone = ini_get('date.timezone');
            $table->AddRow(
            $this->get_test_result(
            $final_result,
            'PHP Timezone:',
            empty($tmezone) ? 'n/a' : $tmezone,
            empty($tmezone),
            'Timezone for PHP is not set. Please set "date.timezone" option in php.ini.'));
            unset($tmezone);

            The "empty($tmezone)" line seemed to be missing a "!". I added it to our 1.6.4 setup.inc.php file and the pre-requisite test complete successfully.

            Comment

            • t2y
              Member
              • Feb 2009
              • 60

              #7
              Hi kdx200rider,

              In my case, I have set related to apache configuration.
              Does it work for you?
              # cat /etc/httpd/conf.d/zabbix.conf
              Alias /zabbix /usr/share/zabbix
              <Directory "/usr/share/zabbix">
              Options FollowSymLinks
              AllowOverride None
              Order allow,deny
              Allow from all
              php_value max_execution_time 300
              php_value date.timezone Asia/Tokyo
              </Directory>

              Comment

              • kdx200rider
                Junior Member
                • Oct 2008
                • 25

                #8
                Thanks t2y,

                The code fix mentioned above has solved my problem. I will try your suggestion also.

                Comment

                • Mikrodots
                  Member
                  • Mar 2008
                  • 37

                  #9
                  Originally posted by kdx200rider
                  I believe I have found the problem. <SNIP>

                  The "empty($tmezone)" line seemed to be missing a "!". I added it to our 1.6.4 setup.inc.php file and the pre-requisite test complete successfully.
                  Same fix worked for me on Centos 5.5 64Bit in a Virtual Machine but my file was here:
                  /usr/local/share/zabbix/include/setup.inc.php

                  I used the script from Brendon Baumgartner as well.

                  # nano /usr/local/share/zabbix/include/setup.inc.php

                  Add ! in front of the line:
                  empty($tmezone),

                  So it looks like this:
                  empty($tmezone) ? 'n/a' : $tmezone,
                  !empty($tmezone),

                  Mikrodots

                  Comment

                  • THUHV
                    Junior Member
                    • Dec 2009
                    • 28

                    #10
                    Originally posted by t2y
                    Hi kdx200rider,

                    In my case, I have set related to apache configuration.
                    Does it work for you?
                    Yes, it work for me, i spend two days to found this way

                    Thanks you!

                    Comment

                    • ubr
                      Junior Member
                      • Jan 2014
                      • 13

                      #11
                      Никак не получается избавиться от ошибки "PHP time zone unknown Fail"
                      Редактировал единственный файл php.ini расположенный в /usr/local/etc/
                      Или нужно создать php.ini в каталоге Апача /usr/local/etc/apache22/ ?

                      Прописал в /usr/local/etc/php.ini

                      extension=/usr/local/lib/php/20100525/timezonedb.so
                      date.timezone = Europe/Moscow

                      Файл timezonedb.so по данному пути есть.

                      NTPS сервис поднял.

                      Что делать?

                      Comment

                      Working...