Ad Widget

Collapse

Timezone for PHP is not set

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sfereday
    Member
    • Jun 2020
    • 30

    #1

    Timezone for PHP is not set

    I've been racking my brain and scouring the internet. I'm still stumped what I'm doing wrong. No mater what I set or where, the timezone is off. It's reflected in the times in Zabbix as well as it states:
    PHP option "date.timezone" unknown Time zone for PHP is not set (configuration parameter "date.timezone").
    Below are my stats.

    Centos 7.8.2003

    zabbix-release-5.0-1.el7.noarch
    zabbix-web-5.0.2-1.el7.noarch
    zabbix-web-mysql-scl-5.0.2-1.el7.noarch
    opsgenie-zabbix-1.1.0-1.x86_64
    zabbix-server-mysql-5.0.2-1.el7.x86_64
    zabbix-web-deps-scl-5.0.2-1.el7.noarch
    zabbix-apache-conf-scl-5.0.2-1.el7.noarch
    zabbix-agent-5.0.2-1.el7.x86_64

    httpd-tools-2.4.6-93.el7.centos.x86_64
    httpd-2.4.6-93.el7.centos.x86_64


    /etc/php.ini

    [Date]
    ; Defines the default timezone used by the date functions
    ; http://php.net/date.timezone
    date.timezone = America/New_York


    I cannot figure out how to set the timezone correctly. I've made the change above to America/New_York, restarted EVERYTHING, but things still won't work. What am I doing wrong?
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    That file is for PHP settings for command-line interpreter. What you need is file /etc/php-fpm.d/zabbix.conf .

    Comment

    • sfereday
      Member
      • Jun 2020
      • 30

      #3
      That file does not exist...

      Comment

      • sfereday
        Member
        • Jun 2020
        • 30

        #4
        I forgot to say, selinux is disabled and firewall is off.

        Comment

        • sfereday
          Member
          • Jun 2020
          • 30

          #5
          ok, I found /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf and it looks like I changed it in another attempt. it says

          [zabbix]
          user = apache
          group = apache

          listen = /var/opt/rh/rh-php72/run/php-fpm/zabbix.sock
          listen.acl_users = apache
          listen.allowed_clients = 127.0.0.1

          pm = dynamic
          pm.max_children = 50
          pm.start_servers = 5
          pm.min_spare_servers = 5
          pm.max_spare_servers = 35

          php_value[session.save_handler] = files
          php_value[session.save_path] = /var/opt/rh/rh-php72/lib/php/session/

          php_value[max_execution_time] = 300
          php_value[memory_limit] = 128M
          php_value[post_max_size] = 16M
          php_value[upload_max_filesize] = 2M
          php_value[max_input_time] = 300
          php_value[max_input_vars] = 10000
          php_value[date.timezone] = America/New_York

          Comment

          • dimir
            Zabbix developer
            • Apr 2011
            • 1080

            #6
            Well yeah, the file depends on things. Did this work for you? Keep in mind that you need to restart php-fpm after this change.

            Comment

            • sfereday
              Member
              • Jun 2020
              • 30

              #7
              Yep, that was it. Thank you. I've been beating my head against the wall.

              Comment

              Working...