'Environment variable in php fpm returns blank when trying to access more than once
Getting the value of the environment variable only once when trying to access it three times.
In my docker container, there is an environment variable:
publication="newpublication"
I have set the "clear_env=no" in www.conf file as well.
I have a function that is being called multiple times:
public function getPublicationName($envname){
$pubname = getenv($envname);
return $pubname;
}
When this function is called 3 times, the output is like the following:
- newpublication
-
-
Any reason why this is happening? I need to get the value of the env variable in all those 3 times but I am getting only once.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
