You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by roger morgan <rm...@yahoo.com.INVALID> on 2014/06/04 10:11:32 UTC

[users] Server-side include problem in Apache 2.4.9 <--#if expr

I'm trying to migrate a website that worked under 2.2. The only change required seems to be in SSI, because the syntax changed from 2.2 to 2.4. I decided not to use the "SSILegacyExprParser on" option because that option might go away in the future.

The site has a .shtml file that contained:
<!--#if expr="${ismember}" -->

The first attempt at conversion was to replace this by:
<!--#if expr="%{ismember}" -->

That doesn't work, it displays:
[an error occurred while processing this directive]
on the webpage, and in apache2's error.log file there appears:

 [include:error] [pid 3616] [client 127.0.0.1:39677] AH01337: Could not parse expr "%{ismember}" in [...]: syntax error, unexpected $end: Variable 'ismember' does not exist

(I've replaced the file path by [...]).
Next, I added the following to the file before the <!--#if :

<!--#set var="ismember" value="something" -->
<!--#echo var="ismember" -->

and tried again.
This time, the line:
something
appeared on the web page. This confirms that SSI is correctly set up and that apache is processing SSI directives in the file.
Yet otherwise the symptoms are the same. Apache still complains in the error.log file that the variable 'ismember' does not exist, despite having just successfully echoed its value to the webpage!

Can anyone see what I am doing wrong? I can't believe that apache2 would get distributed with such a crude bug. I'm using Apache 2.4.9 on Debian Jessie in case it matters.

Roger

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users] Server-side include problem in Apache 2.4.9 <--#if expr

Posted by roger morgan <rm...@yahoo.com.INVALID>.
I solved this problem by not using server-side includes any more. Most of my site's pages were generated by programs anyway, so it wasn't a big task to have them all generated by programs, eliminating the need for SSI.



Roger

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org