我尝试在Mac OS X服务器上的apache Web服务器中安装x_sendfile。安装过程中一切似乎都很好,并且httpd.conf配置为**“LoadModule xsendfile_module libexec/apache2/mod_xsendfile.so”和“XSendFile ON”。
如果我从终端运行“httpd -M”,我可以在列表中看到“xsendfile_module(shared)"**。
但是在phpinfo()或apache_get_modules()中没有列出x-sendfile.如果我尝试在我的php代码中使用x-sendfile来下载任何文件,浏览器只会下载一个0 kb的文件.不过我可以在头数据中看到x-sendfile头标记.
有什么建议吗?
2条答案
按热度按时间8iwquhpp1#
我在CentOS中遇到了类似的问题。
到
httpd.conf
,但是我也确保在PHP页面本身上使用绝对路径如果
httpd -M
显示的是已安装的模块,那么上面的代码应该可以工作。你不会在phpinfo
中看到xsendfile
,因为它不是PHP的扩展。我不能与apache_get_modules()
对话。同样,这是一个基于我个人经验的评论,并不打算成为一个确定的答案。
qlzsbp2j2#
确保
httpd.conf
文件中包含此行。将其添加到页面设置下: