Validation is saying my timezone is wrong

When I go to the “Validate Config” page, I get the error waning saying “FAIL: Time between this server and the mysql database is off Mysql time 2022-08-22 15:01:30 PHP time 2022-08-22 19:01:30”

When I go to the CLI and run validate.php, there are no complaints.

I have all my PHP ini files updated with the correct timezone. My system timezone is also set correctly.

I have a feeling it has to do with how Laravel or Carbon determines the timezone.

Basically while I have everything set to EST, the PHP time is still reported as UTC.

If you look at the code for /LibreNMS/Validations/Database/CheckSqlServerTime.php, it gets the PHP time from:

$php_time = Carbon::now();

At this point, I’m stuck. I’m not sure what I need to change here to get this Carbon library to know my timezone is EST and not UTC.

Did you update this file /etc/php/8.1/fpm/php.ini with your timezone?

here you can find the timezones PHP: Europe - Manual

I sure did, but it made no difference.

$ cat /etc/php/8.1/fpm/php.ini | grep timezone
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
date.timezone = "America/New_York"

Which os are you running?

Ubuntu 20.04

Did you also restarted php8.1-fpm (sudo systemctl restart php8.1-fpm.service)

Looks like that fixed it!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.