-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_paths.php
More file actions
77 lines (67 loc) · 2.18 KB
/
check_paths.php
File metadata and controls
77 lines (67 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Path Diagnostic Script
* This will help us find where storage actually is
*/
if (strpos($_SERVER['HTTP_HOST'], 'localhost') !== false) {
die('This script should only be run on production server!');
}
echo "<h2>Path Diagnostic Tool</h2>";
echo "<pre>";
$currentDir = dirname(__FILE__);
echo "Current script location: {$currentDir}\n\n";
// Check common locations
$pathsToCheck = [
$currentDir . '/storage/app/public',
dirname($currentDir) . '/storage/app/public',
$currentDir . '/../storage/app/public',
'/home/eunixmac/storage/app/public',
'/home/eunixmac/eunixmac_backend/storage/app/public',
'/home/eunixmac/laravel/storage/app/public',
];
echo "Checking possible storage locations:\n";
echo "=====================================\n\n";
foreach ($pathsToCheck as $path) {
$realPath = realpath($path);
if ($realPath && is_dir($realPath)) {
echo "✅ FOUND: {$path}\n";
echo " Real path: {$realPath}\n";
// Check for ads folder
$adsPath = $realPath . '/ads';
if (is_dir($adsPath)) {
$imageCount = count(glob($adsPath . '/*.{jpg,jpeg,png,gif,webp}', GLOB_BRACE));
echo " Has ads folder with {$imageCount} images\n";
} else {
echo " No ads folder yet\n";
}
echo "\n";
} else {
echo "❌ NOT FOUND: {$path}\n\n";
}
}
echo "=====================================\n";
echo "Parent directory contents:\n";
$parentDir = dirname($currentDir);
$contents = scandir($parentDir);
echo "Contents of {$parentDir}:\n";
foreach ($contents as $item) {
if ($item != '.' && $item != '..') {
$fullPath = $parentDir . '/' . $item;
$type = is_dir($fullPath) ? '[DIR]' : '[FILE]';
echo " {$type} {$item}\n";
}
}
echo "\n";
echo "Current directory contents:\n";
$contents = scandir($currentDir);
echo "Contents of {$currentDir}:\n";
foreach ($contents as $item) {
if ($item != '.' && $item != '..') {
$fullPath = $currentDir . '/' . $item;
$type = is_dir($fullPath) ? '[DIR]' : '[FILE]';
echo " {$type} {$item}\n";
}
}
echo "</pre>";
echo "<p><strong>DELETE THIS FILE after viewing results!</strong></p>";
?>