gpt4 book ai didi

php - 找不到 Xsendfile 文件

转载 作者:可可西里 更新时间:2023-10-31 23:34:07 26 4
gpt4 key购买 nike

我在 Dreamhost 上使用 mod_xsendfile 下载大型 zip 文件 (50mb+)

我在我的 .htaccess 中启用了 mod_xsendfile 和“XSendFile on”。

当我给

header('X-Sendfile: "'.$fullPath.'"');

命令,使用服务器上确实存在的文件的完整路径,我收到网页未找到错误。

readfile() 找到文件并提供它,但 .zip 文件已经变得太大,php 无法处理。

如果您能提供任何帮助,我们将不胜感激!

最佳答案

实际上有一个 apache/xsendfile 配置值。

在您的主机配置中,您可以简单地添加:

XSendFilePath /tmp

/tmp 是您希望 xsendfile 能够访问的任何位置。这是一个白名单,我相信你可以添加不止一个。

例如:

<Directory /var/www/mysite/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
XSendFile On
XSendFilePath /tmp
</Directory>

关于php - 找不到 Xsendfile 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7493922/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com