Skip to content

Instantly share code, notes, and snippets.

View rapliandras's full-sized avatar

Rápli András rapliandras

View GitHub Profile
@rapliandras
rapliandras / directus_debug_guide.md
Last active December 6, 2024 11:45
Troubleshooting guide for Directus FORBIDDEN errors

Directus debug guide

Directus is a highly flexible and well architectured CMS, that is by design nearly impossible to debug. You will encounter the following error message for 391 different reasons

[FORBIDDEN] You don't have permission to access this

In other cases you'll just face an Unknown error to further help you on the way. I mean, at least that's not outright misleading.

$inputFileName = "xxxxxx.xlsx";
try {
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($inputFileName);
} catch(Exception $e) {
die('Error loading file "'.pathinfo($inputFileName,PATHINFO_BASENAME).'": '.$e->getMessage());
}