-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
external_parameters access in parameters.yml using _SERVER[...], not _ENV[...], superglobal #23348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't get this report, it's too long :) |
_SERVER vars are set as expected, but the ENV vars -- needed by SF -- are not |
So, |
as shown in the detail of my 'long' report ;-), it appears so. seems pretty clear from reading, at least, that use of ENV is not encouraged |
You're not the only one, see eg. |
got it. though that report is a little thin on the 'why'. coulda been longer! ;-p anyway, thanks for queuing this up. |
fyi Trying to figure out where a 'fix' should best target ... nginx, fcgi/fpm, php, or symfony, I stumbled on this dusty issue:
tho, seems to me that _SERVER vars are the right direction |
…kas) This PR was merged into the 3.3 branch. Discussion ---------- [DI] Fix reading env vars from fastcgi params | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23348 | License | MIT | Doc PR | - Values in fastcgi_param populate `$_SERVER`, never `$_ENV`. This PR makes `$container->getEnv()` read from `$_SERVER`, excluding any vars whose name start by `HTTP_` as that would be a security issue (values injection via HTTP headers.) Embeds a few other fixes found meanwhile. Commits ------- adff65a [DI] Fix reading env vars from fastcgi params
Reading
usage of SYMFONY__ vars has been deprecated,
In my SF 3.3 proj, I config to use env vars for DB credentials,
In nginx config, I define server vars using php-fpm's fastcgi_param,
in php.ini, I've ensured
and in my php-fpm pool conf
but on webserver + php-fpm restart,
are set as expected, but the ENV vars -- needed by SF -- are not
php7's php.ini contains comment that ENV var use is not recommended
this thread
suggests that ENV setting in php-fpm is not reliable (?).
These issues
appear to still refer to / depend on SYMFONY__ env vars, which are, as above, deprecated.
So the question is how, going forward, to access _SERVER[...] vars in parameters/yml so, for example, doctrine:... cmds can use them?
The text was updated successfully, but these errors were encountered: