if (isset($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['DOCUMENT_ROOT'])) {
$doc_root_path = $_SERVER['DOCUMENT_ROOT'];
$resolved_doc_root_path = realpath($doc_root_path);
if ($resolved_doc_root_path !== false) {
if (is_dir($resolved_doc_root_path)) {
if (is_readable($resolved_doc_root_path)) {
$root_dir = $resolved_doc_root_path;
} else {
$error_message = "Error: The determined Document Root path exists but is not readable by the web server (check directory permissions): " . htmlspecialchars($doc_root_path, ENT_QUOTES);
}
} else {
$error_message = "Error: The determined Document Root path is not a directory: " . htmlspecialchars($resolved_doc_root_path, ENT_QUOTES);
}
} else {
$error_message = "Error: The Document Root path ('" . htmlspecialchars($doc_root_path, ENT_QUOTES) . "') reported by the server could not be found or accessed (check server configuration and directory permissions).";
}
} else {
$error_message = "Error: The web server configuration variable \$_SERVER['DOCUMENT_ROOT'] is not available or is empty. Cannot automatically determine the domain's homepage directory. Check your web server configuration (e.g., Apache VirtualHost or Nginx server block).";
}
© 2023 Quttera Ltd. All rights reserved.