Environment configuration as provided by Symfony was enhanced as of eZ Publish 5.2 and eZ Publish Community Project 2013.06 to allow specifying this in the virtual host configuration.
You can configure several environments, from production, development or staging, even if for each one of them you need require using different configurations sets.
Web server configuration
For example, using apache, in the
VirtualHost example in the Virtual host setup chapter the required
VirtualHost configurations have been already included. You can switch to the desired environment by setting the
ENVIRONMENT environment variable to "
dev" or other custom value, as you can see in the following example:
eZ Publish Configuration
If you want to use a custom environment (something else then "
prod" and "
dev") the next step is to create the dedicated configuration files for your environment:
The name used as
<env_name> will be the one that can be used as value of the
ENVIRONMENT environment variable.
Those files must import the main configuration file, just like the default
config_dev.yml already does. Here's an example:
This allows you to override settings defined in the main configuration file, depending on your environment (like the DB settings or any other setting you may want to override).