Online search for an afternoon to find how to configure Apache X-sendfile.
First of all, it is said that only Apache 2.x supports this feature. Next Linux support for this feature requires kernel support. Generally now 2.6 of the inside
The cores are supported, as if they were to be supported by the 2.2 kernel at the earliest.
Test environment:
System: Windows XP
Apache version:
2.11
Secondary script:
PHP 5.2.6
Configuration steps:
1. Download module file
Download in http://www.apachelounge.com/download/
A compiled X-sendfile module in Windows Mod_xsendfile-0.9-w32.zip. Move the file mod_xsendfile.so to the Apache/modules directory after decompression.
2. Configure the Apache configuration file
Configure the following to the configuration file
# load X-sendfile Module
LoadModule xsendfile_module modules/mod_xsendfile.so
Xsendfile on
Xsendfileallowabove on
3. Invoke X-sendfile using PHP
Instance code:
<?php header (' Content-type:application/octetstream '); Header (' content-disposition:attachment; filename= "1.exe"); Header (' X-sendfile:d:/webdocs/zendstudio.exe '); Exit
Reference documents:
Http://blog.sina.com.cn/s/blog_549212ae010086s9.html