Basically, I would like to send a header X-Sendfile to the browser to send a file, but I don't want to call this if the X-Sendfile is not available or installed on the server. How can I check for this in PHP?? Or if this is impossible to check in PHP, than how to check that it is installed PERIOD? I would rather check for the existence of X-Sendfile in PHP, as it would be easier for me to do so, since this is part of a package that will run on other sites and servers as well... Perhaps if I just use it with the PHP header
function, it will return something if not installed??
Thanks guys :)
The APACHE module mod_xsendfile processes the X-Sendfile
headers
To check if the APACHE module mod_xsendfile is available and installed on the server, you could use apache_get_modules() function.
You cannot just set the header and check if the module is installed or not.
To get a list of apache modules and see if x-sendfile is in the list you could use http://php.net/manual/en/function.apache-get-modules.php If it's not installed, the x-sendfile header will get to the browser if it is installed, the module will filter out the header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With