Ad Widget

Collapse

PHP date.timezone CentOS 7 unknown

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

    #1

    PHP date.timezone CentOS 7 unknown

    Let me start with I'm both new to Zabbix and have stayed away from forums for the past decade. So, be gentle.
    I'm working with Zabbix in our test environment. I've updated from 3.2.x to 5.0.x. The update went smoothly from all I can tell. I had some errors in the database that I had to change the consolation of (I can link that article I followed if needed). The errors from that have gone away. But, I cannot shake this one error under Reports--System Information.
    PHP option "date.timezone" unknown Time zone for PHP is not set (configuration parameter "date.timezone").
    I've scoured the server, CentOS 7.8, for any reference. I've found what I believe to be the correct file in /etc/php.ini. I found the setting I believe to be it as:

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

    I changed the bottom line from ;date.timezone = to what you see above. I've restarted everything including the server. The error will not go away. I've searched through these forums and found several references, but none have helped. They have either pointed to a file that doesn't exist or it's something I've found already and tried. I'm spinning my wheels pretty hard here. I know it's something simple, but I cannot for the life of me figure it out. Any suggestions?
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    What you've described all sounds correct, but I suspect the issue may be related to PHP on CentOS 7.x.

    CentOS (and RHEL) 7.x ships with PHP 5.6 as the "base OS" version of PHP.

    Zabbix 5.x requires PHP 7.x (I think 7.2, but you can verify that in the installation guide), which means that on CentOS (and RHEL) the base OS version of PHP won't work. For those platforms, there's multiple alternate versions available from their Software Collections Library (SCL). There are also non-vendor PHP 7.x from other repositories (a lot of people use the "Remy" PHP repo).

    What's probably going on is that /etc/php.ini isn't even being looked at by the version of PHP you're actually using.

    If you're using the PHP version from SCL, its php.ini will be somewhere under /etc/opt/ and a couple directories below that, based on SCL vendor and package version (e.g. /etc/opt/rh/rh-php72/php.ini for the SCL PHP 7.2 on RHEL 7.x. CentOS may use a different vendor abbrev).

    Which version of PHP are you actually using, and where did it come from? You can do something like

    Code:
    rpm -qa | egrep -i php | sort
    and report the list of packages here, and that will give people an idea where the php.ini actually is.

    Also, if you do have both the base OS php-5.6.x (and associated packages) installed, in addition to some newer version with different paths, you'll probably want to uninstall all the base OS PHP packages, so avoid confusion for yourself and any coworkers in the future.

    Comment

    • sfereday
      Member
      • Jun 2020
      • 30

      #3
      I am a super flake. It was PHP. After working with the system for a week or so I was able to upgrade everything on the server. You hit the nail on the head.

      Comment

      Working...