I'm getting a 500 error whilst using PHP to try and get the folder structure for my site, I'm new to PHP and most of what I've done with it is self taught or researched, and this time neither of those could help me solve this.
I am hosting my website with Plesk, using their hosting panel to manage it and I am currently making an 'Admin' area of my site, and wanted to list the structure of my images folder on this. I have tried many different php scripts and all return a 500 error, the log also shows no detail, PHP is enabled and working on my site as I'm using it elsewhere.
My current script is below, I got it here, and edited it for my use. My PHP version is 5.4. Any help would be greatly appreciated.
<?php
function listFolderFiles($dir){
$ffs = scandir($dir);
echo '<ol>';
foreach($ffs as $ff){
if($ff != '.' && $ff != '..'){
echo '<li>'.$ff;
if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);
echo '</li>';
}
}
echo '</ol>';
}
listFolderFiles('Content/images');
?>