Debug Information"; echo "

API_BASE: " . htmlspecialchars(API_BASE) . "

"; echo "

PHP Version:

"; echo phpversion() . "

"; echo "

CURL Support:

"; echo (extension_loaded('curl') ? 'YES' : 'NO') . "

"; echo "

JSON Support:

"; echo (extension_loaded('json') ? 'YES' : 'NO') . "

"; echo "

OpenSSL Support:

"; echo (extension_loaded('openssl') ? 'YES' : 'NO') . "

"; echo "

Error Log Location:

"; echo ini_get('error_log') . "

"; echo "

Last 20 Error Log Entries:

"; $log_file = ini_get('error_log'); if (file_exists($log_file)) { $log_entries = file_get_contents($log_file); $lines = explode("\n", $log_entries); $recent_lines = array_slice($lines, -20); foreach ($recent_lines as $line) { if (trim($line) && strpos($line, 'API') !== false) { echo htmlspecialchars($line) . "
"; } } } else { echo "Error log file not found
"; } echo "

Test Direct API Call:

"; $url = API_BASE . 'login'; $data = json_encode(['username' => 'admin', 'password' => 'admin']); $context = stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => $data, 'timeout' => 10 ] ]); $result = file_get_contents($url, false, $context); echo "Result: " . htmlspecialchars($result) . "
"; if ($http_response_header) { echo "Headers: " . implode('
', $http_response_header) . "
"; }