echo "

🧪 UniFi Portal Directory Test

"; // Current working directory echo "
"; echo "Current Working Directory (getcwd()):
"; echo "" . getcwd() . ""; echo "
"; // __FILE__ constant echo "
"; echo "Full Path to This Script (__FILE__):
"; echo "" . __FILE__ . ""; echo "
"; // __DIR__ constant echo "
"; echo "Directory of This Script (__DIR__):
"; echo "" . __DIR__ . ""; echo "
"; // Check if we're in public_html $currentDir = getcwd(); if (strpos($currentDir, 'public_html') !== false) { echo "
"; echo "✓ SUCCESS: This script is running in the public_html directory!"; echo "
"; } else { echo "
"; echo "âš  Note: This script does NOT appear to be in public_html. It's in: " . $currentDir . ""; echo "
"; } // Server information echo "
"; echo "Server Information:
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
PropertyValue
HTTP_HOST" . ($_SERVER['HTTP_HOST'] ?? 'Not set') . "
REQUEST_URI" . ($_SERVER['REQUEST_URI'] ?? 'Not set') . "
SERVER_ADDR" . ($_SERVER['SERVER_ADDR'] ?? 'Not set') . "
REMOTE_ADDR" . ($_SERVER['REMOTE_ADDR'] ?? 'Not set') . "
PHP_VERSION" . phpversion() . "
"; echo "
"; // Directory listing echo "
"; echo "Contents of Current Directory:
"; $files = scandir(getcwd()); if ($files) { echo ""; echo ""; foreach ($files as $file) { if ($file === '.' || $file === '..') continue; $isDir = is_dir(getcwd() . '/' . $file) ? 'Directory' : 'File'; echo ""; } echo "
NameType
$file$isDir
"; } else { echo "Could not read directory"; } echo "
"; echo ""; echo ""; echo ""; ?>