I'm using an external ExFat harddrive mounted at /Volumes/Samsung and have working symlinks connecting my localhost web server: ln -s /Volumes/Samsung/recordings ~/Developer/example/files/recordings
I can verify readability with python3 and php below. The list returns TRUE for many files with all sorts of ownership and permissions; and everything works as expected when I execute this code from the terminal or bootstrapped through my API project.
$list = [
'~/Developer/example/files/recordings/test.mp4',
'/Volumes/Samsung/recordings/test.mp4', ...
];
foreach($list as $file) {
$permissions = fileperms($file);
$octalPermissions = substr(sprintf('%o', $permissions), -4);
$readable = (is_readable($file) ? 'true' : 'false');
$owner = posix_getpwuid(fileowner($file))['name'];
$group = posix_getgrgid(filegroup($file))['name'];
echo ("IS READABLE: $readable = $octalPermissions | owner: $owner / $group === $file" . PHP_EOL);
}
However, when I try to stream or serve the files:
$response = new BinaryFileResponse('/Volumes/Samsung/recordings/example.mp4');
// or via /User/user/Developer/example/files/recordings/example.mp4
$response->headers->set('Content-Type', 'video/mp4');
return $response->send();
I get
Symfony\Component\HttpFoundation\File\Exception\FileException: File must be readable. in Symfony\Component\HttpFoundation\BinaryFileResponse->setFile() (line 98 of ~/vendor/symfony/http-foundation/BinaryFileResponse.php).
I have Apache running on OSX Ventura and FollowSymLinks is enabled. Even Chrome can load the files fine using the file://
protocol from both the direct and symbolic links.
I installed MacFuse, but not sure if i have I correctly configured yet and find it hard to believe it's necessary given all the other ways I can read from the drive.
How can I use an external ExFat harddive drive as extra Apache file storage on OSX Ventura?