Ad Widget

Collapse

DateTime error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gdelabre
    Junior Member
    • Jun 2019
    • 8

    #1

    DateTime error

    Dear Zabbix forum,

    I would like to ask you about following problems.
    I have installed Zabbix(4.2.3) monitoring on virtual machin on centos 7.6 with this database (MariaDB in mySQL) but Zabbix web Frontend tell me this error:
    DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
    What are the different errors that can cause this error?
    Thank you for your answers.
    Click image for larger version

Name:	Datetime.PNG
Views:	3856
Size:	13.8 KB
ID:	381238
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    If you are configuring with a standard package, enable the commented out date.timezone settings in /etc/httpd/conf.d/zabbix.conf, change to the time zone you want to use and save. Then restart your web server.

    Comment

    • gdelabre
      Junior Member
      • Jun 2019
      • 8

      #3
      Thanks for your help,
      I made the configuration and reboot zabbix server
      but the error is still displayed. Can it come from another file?
      Click image for larger version

Name:	datetime.php.PNG
Views:	4201
Size:	25.4 KB
ID:	381244Click image for larger version

Name:	Datetime.PNG
Views:	3676
Size:	13.8 KB
ID:	381245

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        What version of PHP are you using?
        If you are using PHP 7.x and mod_php, you need to change "mod_php5.c" to "mod_php7.c".
        If you are using php-fpm instead of mod_php, you will need to configure it in /etc/php.ini.

        Comment

        • gdelabre
          Junior Member
          • Jun 2019
          • 8

          #5
          I am in version 5.4 for PHP.
          The problem is solved it was necessary to change the time zone in php.ini and do "httpd reload".
          Thanks for your help,

          Comment

          • jancs
            Member
            • Jul 2014
            • 30

            #6
            Its funny, but neither "Europe/Riga" nor Europe/Riga, nor 'Europe/Riga' is working in php.ini. V 3.4.15, php 5.6.37, I get messages about:
            date(): It is not safe to rely on the system's timezone settings....
            mktime(): It is not safe to rely on the system's timezone settings...
            strtotime(): It is not safe to rely on the system's timezone settings...
            You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

            Comment

            Working...