Re: Mixed PHP/SSI and environment variables
| From: | Jochem Maas | Date: | Fri, 28 Oct 2005 15:20:46 +0000 |
| Subject: | Re: Mixed PHP/SSI and environment variables | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224783@lists.php.net to get a copy of this message | ||
Christoph Freundl wrote:
Am Freitag, 28. Oktober 2005 13:42 schrieb Jochem Maas:I just looked at apache_getenv(): string apache_getenv ( string variable [, bool walk_to_top] ) the second arg maybe something to consider? also does getenv() [http://php.net/getenv] have the same problems?ok, and if you stick the following in 1 file and call it?: <!--#set var="myvar" value="myval" --> <?php echo apache_getenv( "myvar" ); ?> ... just thinking out loud here.
Ok, I tried this by configuring Apache such that .php-files are also parsed for Server Side Includes and wrote it the way you suggest. Now I am really confused: the SSI statements are obviously recognized because they do not appear in the resulting file but a) apache_getenv does still not return the value for the variable but b) if I call phpinfo() instead of apache_getenv the variable "myvar" plus the set value is shown correctly in the "Apache Environment" and c) an SSI "<!--#echo var="myvar" --> after the php block also gives the correct value Perhaps I return to what I primarily intended to ask: is it really the wanted behaviour of virtual() that changes that are made by the included file do not influence the environment of the including file?I would say yes because virtual() create a sub-process, with it _own_ env.
Regards, Christoph