Mixed PHP/SSI and environment variables

From: Date: Thu, 27 Oct 2005 08:43:27 +0000
Subject: Mixed PHP/SSI and environment variables
Groups: php.general 
Request: Send a blank email to php-general+get-224763@lists.php.net to get a copy of this message
Hello, I have a problem with the persistence of environment variables when mixing PHP and SSI (Apache) and I am not sure if I just made an error or if this approach cannot work at all. So please consider the following files: setvar.shtml ------------------------------------------------- <!--#set var="myvar" value="myval" --> ------------------------------------------------- showvar.php ------------------------------------------------- <?php echo apache_getenv( "myvar" ); ?> ------------------------------------------------- info.shtml ------------------------------------------------- <!--#include virtual="setvar.shtml" --> <!--#include virtual="showvar.php" --> ------------------------------------------------- info.php ------------------------------------------------- <?php virtual( "setvar.shtml" ); echo apache_getenv( "myvar" ); ?> ------------------------------------------------- What I would expect is that you get the same result if you call info.shtml and info.php. What happens when I tried (PHP 4.3.10 with both Apache 1.3.33 and 2.0.53): the shtml shows the variable but the php does not, it seems to "forget" the variable set in setvar.shtml. Please, can anybody tell me what is going wrong here? Regards, Christoph -- Christoph Freundl http://www10.informatik.uni-erlangen.de/~chfreund/ Lehrstuhl für Systemsimulation (Inf. 10), Cauerstr. 6, D-91058 Erlangen The earth is like a tiny grain of sand, only much, much heavier.

« previous php.general (#224763) next »