1) "Invalid PHP_SELF Path" when browsing to http://server/cacti
This can be solved by editing include/global.php, lookup the following code snippet:
Code: Select all
/* Sanity Check on "Corrupt" PHP_SELF */
if ((!is_file($_SERVER["PHP_SELF"])) && (!is_file($config["base_path"] . '/' . $_SERVER["PHP_SELF"]))) {
if (!is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["PHP_SELF"])) {
if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"],
$_SERVER["PHP_SELF"])))) {
echo "\nInvalid PHP_SELF Path\n";
exit;
}
}
}
Code: Select all
/* Sanity Check on "Corrupt" PHP_SELF */
/* COMMENTED OUT DUE TO FAIL FOR ALIAS */
/*
if ((!is_file($_SERVER["PHP_SELF"])) && (!is_file($config["base_path"] . '/' . $_SERVER["PHP_SELF"]))) {
if (!is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["PHP_SELF"])) {
if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"],
$_SERVER["PHP_SELF"])))) {
echo "\nInvalid PHP_SELF Path\n";
exit;
}
}
}
*/
2) "...cacti Passed variable is not an array..." when browsing to http://server/cacti
This was solved by editing lib/functions.php, find the following function
Code: Select all
/* read_default_config_option - finds the default value of a Cacti configuration setting
@arg $config_name - the name of the configuration setting as specified $settings array
in 'include/global_settings.php'
@returns - the default value of the configuration option */
function read_default_config_option($config_name) {
global $config, $settings;
reset($settings);
while (list($tab_name, $tab_array) = each($settings)) {
if ((isset($tab_array[$config_name])) && (isset($tab_array[$config_name]["default"]))) {
return $tab_array[$config_name]["default"];
}else{
while (list($field_name, $field_array) = each($tab_array)) {
if ((isset($field_array["items"])) && (isset($field_array["items"][$config_name]))
&& (isset($field_array["items"][$config_name]["default"]))) {
return $field_array["items"][$config_name]["default"];
}
}
}
}
}
Code: Select all
/* read_default_config_option - finds the default value of a Cacti configuration setting
@arg $config_name - the name of the configuration setting as specified $settings array
in 'include/global_settings.php'
@returns - the default value of the configuration option */
function read_default_config_option($config_name) {
global $config, $settings;
if (is_array($settings)) {
reset($settings);
while (list($tab_name, $tab_array) = each($settings)) {
if ((isset($tab_array[$config_name])) && (isset($tab_array[$config_name]["default"]))) {
return $tab_array[$config_name]["default"];
}else{
while (list($field_name, $field_array) = each($tab_array)) {
if ((isset($field_array["items"])) && (isset($field_array["items"][$config_name]))
&& (isset($field_array["items"][$config_name]["default"]))) {
return $field_array["items"][$config_name]["default"];
}
}
}
}
}
}