Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symfony: How to set configuration parameters files for different environments?

How to setup a different configuration parameters file for each environment?

At the moment parameters in parameters.yml are used in both dev and prod environment, but I need different parameters in order to deploy my app in prod.

like image 764
user3174311 Avatar asked Mar 29 '15 10:03

user3174311


1 Answers

You can put all the parameters used in your dev environment in a app\config\parameters_dev.yml file (you need to create it) and then import it in your app\config\config_dev.yml:

imports:
    - { resource: config.yml }
    - { resource: parameters_dev.yml }

So when you work in local any parameter used in production will be overwritten by the new file with the right parameters.

And remember to Clear the cache!

like image 88
gp_sflover Avatar answered Sep 29 '22 02:09

gp_sflover