Files
sam-sales/fix_env.php

34 lines
1.1 KiB
PHP
Raw Normal View History

<?php
header('Content-Type: text/plain; charset=utf-8');
echo "=== Detailed File Listing (ls -al) ===\n";
$path = __DIR__;
echo "Current Path: $path\n\n";
// 현재 디렉토리와 상위 디렉토리 리스트 출력
echo "--- Files in " . $path . " ---\n";
echo shell_exec("ls -al $path") . "\n";
echo "--- Files in " . dirname($path) . " ---\n";
echo shell_exec("ls -al " . dirname($path)) . "\n";
echo "\n=== Trying to Read .env directly ===\n";
$envFiles = [ $path.'/.env', dirname($path).'/.env', $path.'/.env.php' ];
foreach($envFiles as $f) {
if (file_exists($f)) {
echo "[EXISTS] $f (Size: " . filesize($f) . " bytes)\n";
if (is_readable($f)) {
echo "--- Content (Masked) ---\n";
$lines = file($f);
foreach($lines as $line) {
if(strpos($line, 'PASS') !== false) echo explode('=', $line)[0] . "=********\n";
else echo $line;
}
} else {
echo "[ERROR] File exists but NOT READABLE by " . `whoami` . "\n";
}
} else {
echo "[NOT FOUND] $f\n";
}
}