i'm using an ubuntu:18.04 container with nginx and php-fpm7.2. I set
clear_env=no
in /etc/php/7.2/fpm/pool.d/www.conf and
variables_order = "EGPCS"
in /etc/php/7.2/fpm/php.ini
I pass pass a variable $myVar from docker-compose. Running
echo $myVar
shows the correct value.
Running php -r "echo getenv('myVar');" shows me the correct value.
Placing a file index.php into /var/www/html/ (this is my www root) containing
<?php
echo getenv('myVar');
?>
returns me an empty string.
Can someone help me?
Thank you, Martin
php-fpm? Is it the one you're logged in when you invokephp -r "echo getenv('myVar');"via command-line?