🔍 Check Gambar Berita";
echo "
1. File di storage/app/public/berita/
";
if (file_exists($imagePath)) {
echo "✅ File ADA di: $imagePath
";
echo "Ukuran: " . filesize($imagePath) . " bytes
";
} else {
echo "❌ File TIDAK ADA di: $imagePath
";
}
echo "2. File di public/storage/berita/ (symlink)
";
if (file_exists($publicPath)) {
echo "✅ File ACCESSIBLE di: $publicPath
";
echo "Ukuran: " . filesize($publicPath) . " bytes
";
} else {
echo "❌ File TIDAK ACCESSIBLE di: $publicPath
";
}
echo "3. Test URL
";
$url = 'http://localhost/TugasAkhir/sim-pkpps/public/storage/berita/cxPh4dGaR6qpyPeshxvSQAjgaY7xef9t180dgShU.jpg';
echo "URL: $url
";
if (file_exists($publicPath)) {
echo "
";
echo "Jika gambar di atas tidak muncul, berarti ada masalah CORS atau server config.
";
}
echo "4. Symlink Check
";
$symlinkPath = __DIR__ . '/sim-pkpps/public/storage';
if (is_link($symlinkPath)) {
echo "✅ Symlink EXISTS
";
echo "Target: " . readlink($symlinkPath) . "
";
} else if (is_dir($symlinkPath)) {
echo "✅ Directory EXISTS (bukan symlink)
";
} else {
echo "❌ Storage link TIDAK ADA!
";
echo "Solusi: Jalankan php artisan storage:link
";
}
?>