With litespeed $_ENV array is empty

wanah

Well-Known Member
#1
Hello,

One of our customers, running owncloud requested some help beacause own Cloud reports getenv('path') as empty.

I checked and $_ENV is an ampty array.

I know PHPFPM empties this variable by default and you have to set clear_env to no for it to not clear the $_ENV variables.

Does litespeed to the same ? If so is there a way to disbale clearing server environement variables ?

Thanks
 

wanah

Well-Known Member
#3
Hello,

I'm not trying to add new variables but find out why existing ones with standard apache aren't available with litespeed.

On our Apache server PATH is set and $_ENV contains the same info as $_SERVER

Is it Litspeed that removes everything fomr $_ENV ?

For instane PATH is supposed to contain "/bin:/usr/bin"

If we enter it manually and it changes for some reason or another we would have to remeber to enter litespeed configuration to change it there too.

Thanks
 

mistwang

LiteSpeed Staff
#4
Apache suPHP is running PHP as CGI, all request variables are passed as real environment variables, $_SERVER[] is based on that.
LiteSpeed is using our own API and protocol to pass request variables directly into $_SERVER[], $_ENV is the original environment when lsphp process starts, it does not change from request to request.
Fundamentally, they work in different way.
 
Top