-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Environment variables from vhost not passed to service container in production #19015
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
@denormalizer Can you post the relevant parts of config.yml(with passwords masked of course), I'll try to repeat the issue? Also I'm assuming you did: |
Hi @PavelPetrov-WebBambooLtd, That's correct. I did run cache:clear --env=production. I've updated the post to make it clearer. |
This is related to #18155 (and a bunch of older tickets referenced in that). |
@magnusnordlander Thanks for the headsup |
This seems to be the solution moving forward: #19681 Although only available from Symfony 3.2 |
Yes, and unfortunately, there is no way to "fix" this for older versions. |
Uh oh!
There was an error while loading. Please reload this page.
I'm using the following technique to set some environment variables (db params in particular):
As described in the document, they need to be set in two different places:
When in the development environment (app_dev.php) and connecting to the DB
the $db object references the correct database as defined in my vhost.
However, when in production environment (app.phpp) and connecting to the DB, the $db object references the database as defined in the CLI instead.
I've been able to mitigate this issue by setting debug to true in the front controller:
So, it seems like a caching issue but I'm not sure if it's a Symfony or a Propel issue.
Also, I wonder if this issue may be related: #7555
How To Reproduce
Vhost
config.yml
parameters.yml
Clear Cache CLI
Environment
OS: CentOS 7
Apache: 2.4.6
PHP: 5.6
Symfony: 2.8 (standard framework edition)
ORM: Propel
Database adapter: mssql
Database driver: pdo_dblib
The text was updated successfully, but these errors were encountered: