Re: Conditionally LoadModule?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14/11/16 07:59 PM, Eric Covener wrote:
On Mon, Nov 14, 2016 at 9:40 PM, Jack Bates <4ecvsm@xxxxxxxxxxxxxxxx> wrote:
Why doesn't the following work?

<If "-f /usr/lib/apache2/modules/libphp7.0.so">
    LoadModule php7_module      modules/libphp7.0.so
</If>
<Else>
    LoadModule php5_module      modules/libphp5.so
</Else>

/usr/lib/apache2/modules/libphp7.0.so exists on my system,
but Apache keeps trying to load /usr/lib/apache2/modules/libphp5.so:

Cannot load modules/libphp5.so into server:
/usr/lib/apache2/modules/libphp5.so: 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.

Thank you for this helpful reply.
Just a thought: Would it make sense to evaluate <If> both at startup and during request processing? Like is that a reasonable feature request?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux