httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <>
Subject Re: [users@httpd] Conditionally LoadModule?
Date Tue, 15 Nov 2016 02:59:29 GMT
On Mon, Nov 14, 2016 at 9:40 PM, Jack Bates <> wrote:
> Why doesn't the following work?
>> <If "-f /usr/lib/apache2/modules/">
>>     LoadModule php7_module      modules/
>> </If>
>> <Else>
>>     LoadModule php5_module      modules/
>> </Else>
> /usr/lib/apache2/modules/ exists on my system,
> but Apache keeps trying to load /usr/lib/apache2/modules/
>> Cannot load modules/ into server:
>> /usr/lib/apache2/modules/ cannot open shared object file: No such
>> file or directory

It should be syntactically rejected but probably isn't because of a bug.

LoadModule is executed while being read at startup.
<if> is evaluated during request processing, so it's obviously far too late.

I do have a patch for <IfFile> that acts like <ifDefine> (works at
startup) somewhere that would satisfy this kind of config. Otherwise,
you need to do the test -f in a startup script, then pass -DFOO to
apachectl based on the result, and use IfDefine in your config.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message