Re: Mixed PHP/SSI and environment variables

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

 



Christoph Freundl wrote:
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" );

have yuou tried include/require here instead of virtual()

I imagine that the env of the subprocess wouldn't affect
the env of the parent process - i.e. to me it makes sense
if you say the env var in the subprocess is not available in
the parent process.

  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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux