如何在 OSX 上将外部 ExFat 驱动器用作本地主机 Web 服务器存储?

如何在 OSX 上将外部 ExFat 驱动器用作本地主机 Web 服务器存储?

我正在使用安装在 /Volumes/Samsung 的外部 ExFat 硬盘,并且有连接我的本地主机 Web 服务器的有效符号链接:ln -s /Volumes/Samsung/recordings ~/Developer/example/files/recordings

我可以在下面使用 python3 和 php 验证可读性。对于具有各种所有权和权限的许多文件,列表返回 TRUE;当我从终端执行此代码或通过我的 API 项目引导时,一切都按预期工作。

$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);
  }

但是,当我尝试流式传输或提供文件时:

$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();

我明白了 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).

file://我在 OSX Ventura 上运行 Apache,并且启用了 FollowSymLinks。甚至 Chrome 都可以使用该协议从直接链接和符号链接顺利加载文件。

我安装了 MacFuse,但不确定我是否已经正确配置,并且考虑到我可以从驱动器读取的所有其他方式,我很难相信它是必要的。

如何在 OSX Ventura 上使用外部 ExFat 硬盘驱动器作为额外的 Apache 文件存储?

相关内容