Skip to content

Add environment variables #8974

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

Merged
merged 3 commits into from
Jan 10, 2018
Merged

Add environment variables #8974

merged 3 commits into from
Jan 10, 2018

Conversation

ProfM2
Copy link
Contributor

@ProfM2 ProfM2 commented Jan 3, 2018

Add server environment variables, specifically for production use.

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ProfM2 I like this, thanks for contributing it. However, using env vars is optional (even in Symfony 4), so I reworded your config to mention that it's optional. Thanks!

@xabbuh
Copy link
Member

xabbuh commented Jan 9, 2018

There are more virtual host config examples on this page. Should we update them all? And what about the Nginx example config?

@javiereguiluz
Copy link
Member

I wouldn't add them in the other Apache examples ... but if someone knows nginx, please tell us which is the equivalent config to add. Thanks!

@xabbuh
Copy link
Member

xabbuh commented Jan 9, 2018

# optionally set the value of the environment variables used in the application
# fastcgi_param APP_ENV prod;
# fastcgi_param APP_SECRET <app-secret-id>;
# fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";

That should do the trick.

Copy link
Contributor Author

@ProfM2 ProfM2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@xabbuh xabbuh added this to the 4.0 milestone Jan 9, 2018
@javiereguiluz
Copy link
Member

@ProfM2 thank you for helping us improving this. It was a nice first contribution to Symfony Docs. Congrats!

@javiereguiluz javiereguiluz merged commit ab2c135 into symfony:4.0 Jan 10, 2018
javiereguiluz added a commit that referenced this pull request Jan 10, 2018
This PR was merged into the 4.0 branch.

Discussion
----------

Add environment variables

Add server environment variables, specifically for production use.

Commits
-------

ab2c135 Added the env vars in the nginx config too
45c2939 Commented the env vars and mentioned that they are optional
f64bc6b Add environment variables
@ProfM2 ProfM2 deleted the patch-1 branch January 11, 2018 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants