Project

General

Profile

[Solved] How to get Lighttpd active modules from inside PHP

Added by matamouros almost 10 years ago

Hi,

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?

Thank you,
Pedro.


Replies (3)

RE: How to get Lighttpd active modules from inside PHP - Added by stbuehler almost 10 years ago

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.

RE: How to get Lighttpd active modules from inside PHP - Added by matamouros almost 10 years ago

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.

Thanks,
Pedro.

RE: How to get Lighttpd active modules from inside PHP - Added by gstrauss almost 7 years ago

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.

    (1-3/3)