mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Show full path to ini file for timezone errors. (#11444)
This commit is contained in:
@@ -145,17 +145,19 @@ class Php extends BaseValidation
|
|||||||
);
|
);
|
||||||
} elseif ($sh_tz !== $php_tz) {
|
} elseif ($sh_tz !== $php_tz) {
|
||||||
// check if system timezone matches the timezone of the current running php
|
// check if system timezone matches the timezone of the current running php
|
||||||
|
$ini_file = php_ini_loaded_file();
|
||||||
$validator->fail(
|
$validator->fail(
|
||||||
"You have a different system timezone ($sh_tz) than the php configured timezone ($php_tz)",
|
"You have a different system timezone ($sh_tz) than the php configured timezone ($php_tz)",
|
||||||
"Please correct either your system timezone or your timezone set in php.ini."
|
"Please correct either your system timezone or your timezone set in $ini_file."
|
||||||
);
|
);
|
||||||
} elseif ($php_tz !== $php_cli_tz) {
|
} elseif ($php_tz !== $php_cli_tz) {
|
||||||
// check if web and cli timezones match (this does nothing if validate.php is run on cli)
|
// check if web and cli timezones match (this does nothing if validate.php is run on cli)
|
||||||
// some distros have different php.ini for cli and the web server
|
// some distros have different php.ini for cli and the web server
|
||||||
if ($sh_tz !== $php_cli_tz) {
|
if ($sh_tz !== $php_cli_tz) {
|
||||||
|
$ini_file = rtrim(shell_exec('php -r "echo php_ini_loaded_file();"'));
|
||||||
$validator->fail(
|
$validator->fail(
|
||||||
"The CLI php.ini ($php_cli_tz) timezone is different than your system's timezone ($sh_tz)",
|
"The CLI php.ini ($php_cli_tz) timezone is different than your system's timezone ($sh_tz)",
|
||||||
"Edit your CLI php.ini file and set the correct timezone ($sh_tz)."
|
"Edit your CLI ini file $ini_file and set the correct timezone ($sh_tz)."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user