Forum Moderators: coopster

Message Too Old, No Replies

Second SSI include .php not executing

Development server running Red Hat Linux 8.0

         

dabarth

11:42 am on Jun 24, 2005 (gmt 0)

10+ Year Member



I have two websites. The production website is on a virtual hosting environment. The development website is on a PC clone running Red Hat Linux 8.0. The development site has been up and running great for about 3 years. I posted on the Apache Web Server forum and got not answers.

The site uses .shtml SSI pages with cgi scripts and php code as includes. Muliple includes on the same .shtml page using exec cgi-bin work just fine.

I just recently ran accross a problem where the addition of a second php include in the same .shtml page does not execute on the development server.

Here is test.shtml

<html>
<head></head>
<body>
<!--#include virtual="/stuff1.php"-->
<!--#include virtual="/stuff2.php"-->
</body>
</html>

Here is stuff1.php

<?php
echo "Hello world from stuff1.php\n";
?>

Here is stuff2.php

<?php
echo "Hello world from stuff2.php\n";
?>

Here is the output of test.shtml in the browser

Hello world from stuff1.php

Here is the html output of test.shtml

<html>
<head></head>
<body>
Hello world from stuff1.php

<?php
echo "Hello world from stuff2.php\n";
?>
</body>
</html>

I can't seem to find the cause of this problem. Any Ideas out there?

Thanks,

jatar_k

4:16 pm on Jun 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld dabarth,

that's a tough one. It seems strange that the first works and the second doesn't, I can't see why it would look at the two of them differently.

have you tried anything else to trick it into working?

I wonder if outputting some text between the 2 includes would change anything.

To be honest I am not sure, I assume there is no extra information in any logs or you don't get any errors.

Philosopher

4:39 pm on Jun 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A quick search on google for this brings up a few other mentions of this. It looks like it's a bug in apache that causes only one include of a php file to be executed when using "include virtual". All others simply output the source.

Edit...a bit more research shows this is caused by a problem in apache 2. If you can use a different version of apache, you should be ok.

dabarth

5:52 pm on Jun 24, 2005 (gmt 0)

10+ Year Member



A bug? There is no indication in the server logs that anything is amiss. The version of apache that is on the development server is Apache/2.0.40 (Red Hat Linux).

I have been beating myself over my head on this one. I have googleed up and down the web and there appears to be no one who has mentioned this as bug.

Guess I need to spend the weekend installing the latest apache stuff.

Thanks for the info.

Dave,

Philosopher

6:04 pm on Jun 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You won't get any indication. It's an issue with the apache2filter for php. It only processes the first one correctly.

The threads I read stated that the fix wouldn't be happening anytime soon.

For a good read on exactly this visit

[bugs.php.net...]