This question is an exact duplicate of:
Given is a Unix environment with Apache 2.4.29 and PHP 7.1.13 running as an Apache module.
I have a .shtml
file which performs SSI virtual includes
of other resources. Two of them are PHP
scripts. The first scripts performs some action, and the second scripts outputs data. I cannot change this structure. Now I want to pass data from script1 to script2. My first guess was to use PHP with apache_setenv
in script1 and apache_getenv
in script2. Unfortunately script2 cannot see the new environment entries created in script1. Then I tried apache_note()
, which gives the same negative effect.
I am wondering if PHP is working well with such an SSI environment. Using <!--#set var="variable" value="value"-->
in .shtml files makes variable
variable available for all following include virtual calls. But PHP denies this, at least in my setup. Any suggestions? Thanks in advance!
</div>
SSI environment
There's no such thing as "SSI environment". It's just a httpd feature.
Now I want to pass data from script1 to script2
If both talk to remote http client you can try to use session for this. If not, then you can always save temporary file in script1
(i.e. JSON, or serialized data) and read in script2
.