I’m looking at finding a way of checking if an apache module is loaded within a PHP script. The module in question is mod_xsendfile so that I can determine if I can use the X-SENDFILE header to output a secure file to the browser if available, or if I need to use readfile(). Any help is appreciated
I’m looking at finding a way of checking if an apache module is loaded
Share
Even if you find out that
mod_xsendfileis loaded from within PHP, you need to keep in mind that this says nothing about it’s configuration. You can not just automagically use it, because if available, it requires specific configuration to work with your PHP script.Apart from that, there is
apache_get_modulesif you use PHP as an apache module itself.