I want to check whether mod_headers and mod_expires modules enabled or not in my server
Is there a way available to list apache enabled/disabled modules using some php function just like we list php information with phpinfo(); function?
All the above answers are wrong. Use instead:
apachectl -t -D DUMP_MODULES
or
apachectl -M