apache+php+ssi

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
yelena
Forum Newbie
Posts: 2
Joined: Fri May 11, 2007 3:45 am

apache+php+ssi

Post by yelena »

Hi

I have the problem with apache+ php+ssi configuration. The environment variables that I set in php script are not accessible in ssi.
for example, code in php:

Code: Select all

apache_setenv('USER_ID', $_SESSION['user_id']);
then I include this php file into .shtml page with ssi virtual include

end the next code returns (none).

Code: Select all

<!--#echo var="USER_ID" -->
There is no problem with virtual include, it is works correctly. But what doesn't allow to see the env. variables which was set in php script?

This problem appared when there was a rebuilting of apache+ssi+php to make ssi visible in php scripts. Earlier apache_setenv() worked correctly.
If I try do this

Code: Select all

echo '<!--#set var="USER_ID" value="' . $user_id . '" -->';
ssi echo works.

in apache_setenv() function description is written "set Apache-variable subprocess_env". What is the subprocess_env? Is it separate process that separated from the process where I use ssi variable? The variables set ssi are global and variables set apache_setenv() are not, aren't they?

The third apache_setenv() argument doesn't play any role in my case. what does it do if it is set to true or false?

Thanks very much!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why would you use SSI if you have PHP?
Arawn
Forum Commoner
Posts: 42
Joined: Sat May 05, 2007 6:03 am

Post by Arawn »

apache_setenv() returns false on failure, have you checked the return value?
yelena
Forum Newbie
Posts: 2
Joined: Fri May 11, 2007 3:45 am

Post by yelena »

Arawn wrote:apache_setenv() returns false on failure, have you checked the return value?
it returns true. I can get this variable using getenv() in this and other php scripts. but ssi doesn't see it

feyd wrote:Why would you use SSI if you have PHP?
I use cause I have to. It's not my choice. The CMS that we use requires to code in such a way. Do not want to describe it... )
Post Reply