[Solved] How to get Lighttpd active modules from inside PHP
I'm sure this might be a really simple question, for I can't find anywhere how to do this or if it even applies in Lighttpd's case. Is it possible to actually check programmatically from inside PHP if mod_rewrite (or any other module) is active for Lighttpd?
Yes, it is theoretically possible. Depending on your definition of "active" it might be really hard (analyzing the runtime binary) or just hard (reading the config).
I can't imagine any situation where this would actually be necessary anyway.
Ok, is it possible to disable mod_rewrite in Lighttpd like with Apache? I have a small PHP system checking script that checks for Apache mod_rewrite, and I was trying to make it work with Lighttpd. If mod_rewrite is always available in Lighttpd - as in, not possible to disable, unload, or whatever -, then that wouldn't be necessary to check once Lighttpd was discovered to exist in the system.
To obtain the list of loaded modules, run ./lighttpd -p -f lighttpd.conf and look at the server.modules = ( ... ) multi-line statement. Ignore lines that begin with # (or whitespace and then #)
Yes, it is possible to not load mod_rewrite by not specifying the module in lighttpd.conf. If you have a static build, that is a different story, but there are no rewrite rules by default, so you have to define them in the configuration, and you'll see that with ./lighttpd -p -f lighttpd.conf, too.