Ad Widget

Collapse

date.timezone woes???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamied66
    Member
    • Sep 2008
    • 37

    #1

    date.timezone woes???

    I've been looking for an answer for a while, and several people have made simple errors on this, but mine just isn't working.

    I have Zabbix 1.4.6 installed on CentOS 5.2 from the EPEL repos. Standard install. nothing fancy at all.

    This is a test box to hopefully move into a more permanent home soon.

    Code:
    [root@localhost zabbix]# cat /etc/php.ini | grep timezone
    ; Defines the default timezone used by the date functions
    date.timezone = "America/New_York"
    But I keep getting this error when setting up Zabbix (the only error I'm getting).

    From the setup.php script:

    PHP Timezone: n/a Fail

    but it's reading the value for the max execution time correctly:

    PHP max execution time: 300 sec Ok

    I'm at a loss. Can someone please advise.

    The only thing that's been done to this box was to disable SELinux. Could that have something to do with it?
  • jamied66
    Member
    • Sep 2008
    • 37

    #2
    I've re-enabled SELinux, and that has had 0 effect.

    This is really stumping me.

    Thanks for any insight.

    Comment

    • tchjts1
      Senior Member
      • May 2008
      • 1605

      #3
      maybe try it without quotes around the location?

      Here's mine -

      cat /etc/php5/apache2/php.ini | grep timezone
      ; Defines the default timezone used by the date functions
      date.timezone = America/Los_Angeles

      Comment

      • jamied66
        Member
        • Sep 2008
        • 37

        #4
        I've tried double-quotes, single-quotes, no quotes, and multiple time-zones.

        I'm still getting this error.

        Can someone at least point me to right include? I'm in the tall grass on this one.

        Thanks for any insight.

        Comment

        • tchjts1
          Senior Member
          • May 2008
          • 1605

          #5
          My only other thought is ... is that the correct php.ini that you are making changes to? I have Zabbix installed on Ubuntu, so not sure what your config is... but I have 2 iterations of php.ini

          find / -name php.ini 2>/dev/null
          /etc/php5/cli/php.ini
          /etc/php5/apache2/php.ini

          Comment

          • arajkuma
            Junior Member
            • Nov 2008
            • 4

            #6
            Timezone for PHP is not set. Please set "date.timezone" option in php.ini.

            I am also getting same problem with php5 on SUSE Enterprise 10.
            Did any one resolved this?

            Comment

            • MikeBreton
              Junior Member
              • Nov 2009
              • 19

              #7
              date.timezone problem

              I have added an entry in my RHEL5.1 /etc/httpd/conf.d/php.conf file:

              date.timezone = 'US/Eastern'

              which when uncommented causes httpd to complain:

              [root@ct2xdodb6a httpd]# service httpd restart
              Stopping httpd: [ OK ]
              Starting httpd: Syntax error on line 32 of /etc/httpd/conf.d/php.conf:
              Invalid command 'date.timezone', perhaps misspelled or defined by a module not included in the server configuration
              [FAILED]
              my php.conf appears as follows:

              #
              # PHP is an HTML-embedded scripting language which attempts to make it
              # easy for developers to write dynamically generated webpages.
              #

              LoadModule php5_module modules/libphp5.so

              #
              # Cause the PHP interpreter to handle files with a .php extension.
              #
              #AddHandler php5-script .php
              #AddType text/html .php

              AddHandler application/x-httpd-php .php
              AddHandler application/x-httpd-php-source .phps

              #
              # Add index.php to the list of files that will be served as directory
              # indexes.
              #
              DirectoryIndex index.php

              #
              # Uncomment the following line to allow PHP to pretty-print .phps
              # files as PHP source code:
              #
              #AddType application/x-httpd-php-source .phps

              #
              # Default Time Zone
              #
              date.timezone = US/Eastern

              PHP is 5.1.6, Apache is 2.2

              Apache loads fine if I comment out the date.timezone entry in the php.conf

              Zabbix 1.6.6 seems to require it in the Step 3 PreRequisites.

              I'm thoroughly stumped!

              Comment

              • Crazy Marty
                Member
                • Sep 2007
                • 75

                #8
                /etc/httpd/conf.d/php.conf is only for directives to apache (i.e., suitable for inclusion in /etc/httpd/conf/httpd.conf). So the "date.timezone=" directive definitely does not go in that file.

                You're on the right track, though: you need to find the php.ini file that is loaded by mod_php (which is loaded by apache when it reads /etc/httpd/conf.d/php.conf).

                As a previous poster suggested:

                find / -name php.ini -print

                will find it (eventually).

                Comment

                • MikeBreton
                  Junior Member
                  • Nov 2009
                  • 19

                  #9
                  Marty,

                  Thanks so much, your reply triggered a memory of modifying the max_execution_time to 300 in the /etc/php.ini. Then the message text popped into my head with the php.INI highlighted not php.CONF. I had just assumed that THEY MEANT php.conf (too much working with the other platform) and repeatedly tried to make the change in that file. I now understand the different functionality brought to the table by each file (the .conf file deals with the Apache interface, the .ini file deals with PHP environment). Good lesson. Thanks again.

                  I'm sure a lot of us got tripped up on this one.

                  Comment

                  • briandunaway
                    Junior Member
                    • Jun 2010
                    • 1

                    #10
                    restarted apache

                    I edited my php.ini file and it was the same problem. Then the light bulb in my head went off. Restarted Apache. Ding. Success.

                    Comment

                    • berbus
                      Junior Member
                      • Jul 2017
                      • 1

                      #11
                      Silly as it is and it case it helps anyone, be sure you remove de ";" before date.timezone in php.ini

                      Comment


                      • krossyomind
                        krossyomind commented
                        Editing a comment
                        EGGZACKLEE BerBus! That was my fix
                    Working...