<?php
echo '<pre>';
echo 'HOME env: ' . getenv('HOME') . "\n";
echo 'Server HOME: ' . ($_SERVER['HOME'] ?? 'n/a') . "\n";
echo '__DIR__: ' . __DIR__ . "\n";
echo 'One level up: ' . dirname(__DIR__) . "\n";
echo 'Two levels up: ' . dirname(dirname(__DIR__)) . "\n";
echo 'posix_getpwuid: ';
print_r(posix_getpwuid(posix_getuid()));
echo '</pre>';