I am using .env file and docker-compose together with: php:8.2.3-fpm image.
In order for ENV variables to be visible in the PHP script, I’ve had to add: clear_env=no to php-fpm.conf file.
Everything works nicely, however the issue I am having is that when I set up Xdebug from PhpStorm to debug PHP script (using remote SSH interpreter to my Docker FPM container) I can’t see the .env variables.
When I SSH into the container and try to print out the ENV variable, e.g.: php -r 'print getenv("POSTGRES_PASS");' it’s printed correctly. It’s only an issue when running an Xdebug session from the PhpStorm.
When Xdebug session is initiated through browser (XDEBUG_SESSION_START=PHPSTORM) then env variables are available correctly.
I am wondering if there is any PhpStorm or XDebug cli setting which explicitly cleans/ignores environmental variables.
They’re clearly available inside of the container.
Any hints very much appreciated !
Thanks